8000 minor #13980 ADD Annotations for The Locale and the URL section (Squa… · symfony/symfony-docs@5451fd8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5451fd8

Browse files
committed
minor #13980 ADD Annotations for The Locale and the URL section (SquareInnov)
This PR was submitted for the 5.1 branch but it was squashed and merged into the 4.4 branch instead. Discussion ---------- ADD Annotations for The Locale and the URL section ADD Annotations example for The Locale and the URL section. Commits ------- 89ffeb1 ADD Annotations for The Locale and the URL section
2 parents b34d97e + 89ffeb1 commit 5451fd8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

translation/locale.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ A better policy is to include the locale in the URL using the
6464

6565
.. configuration-block::
6666

67+
.. code-block:: php-annotations
68+
69+
// src/Controller/ContactController.php
70+
namespace App\Controller;
71+
72+
// ...
73+
class ContactController extends AbstractController
74+
{
75+
/**
76+
* @Route(
77+
* "/{_locale}/contact",
78+
* requirements={
79+
* "_locale": "en|fr|de",
80+
* }
81+
* )
82+
*/
83+
public function contact()
84+
{
85+
}
86+
}
87+
6788
.. code-block:: yaml
6889
6990
# config/routes.yaml

0 commit comments

Comments
 (0)
0