diff --git a/translation/locale.rst b/translation/locale.rst index 2dfd7c80b7c..c411221ebc7 100644 --- a/translation/locale.rst +++ b/translation/locale.rst @@ -64,6 +64,27 @@ A better policy is to include the locale in the URL using the .. configuration-block:: + .. code-block:: php-annotations + + // src/Controller/ContactController.php + namespace App\Controller; + + // ... + class ContactController extends AbstractController + { + /** + * @Route( + * "/{_locale}/contact", + * requirements={ + * "_locale": "en|fr|de", + * } + * ) + */ + public function contact() + { + } + } + .. code-block:: yaml # config/routes.yaml