From 2748e2eb79573d8dabfa7e2ec6054cd78a36bacd Mon Sep 17 00:00:00 2001 From: mgasmi Date: Thu, 9 Jun 2022 23:01:23 +0200 Subject: [PATCH] [Translation] Update locale.rst --- translation/locale.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/translation/locale.rst b/translation/locale.rst index 33e287e1c4b..d4a28f74961 100644 --- a/translation/locale.rst +++ b/translation/locale.rst @@ -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