From 89ffeb17ccbffe460ba4c01d220ddb92fa3a2f40 Mon Sep 17 00:00:00 2001 From: SquareInnov Date: Sun, 19 Jul 2020 03:07:28 +0200 Subject: [PATCH] ADD Annotations for The Locale and the URL section --- translation/locale.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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