Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions translation/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ A better policy is to include the locale in the URL using the
{
}
}

.. code-block:: php-attributes

// src/Controller/ContactController.php
namespace App\Controller;

// ...
class ContactController extends AbstractController
{
#[Route(
path: '/{_locale}/contact',
name: 'contact',
requirements: [
'_locale' => 'en|fr|de',
],
)]
public function contact()
{
}
}

.. code-block:: yaml

Expand Down