Skip to content

Commit 1775132

Browse files
committed
minor #12460 Update routing.rst (ymc-sise)
This PR was merged into the 4.3 branch. Discussion ---------- Update routing.rst According to #12455 Fix variable name from locale to _locale in requirements. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- d7b7f86 Update routing.rst
2 parents be31007 + d7b7f86 commit 1775132

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ the common configuration using options when importing the routes.
11321132
use Symfony\Component\Routing\Annotation\Route;
11331133
11341134
/**
1135-
* @Route("/blog", requirements={"locale": "en|es|fr"}, name="blog_")
1135+
* @Route("/blog", requirements={"_locale": "en|es|fr"}, name="blog_")
11361136
*/
11371137
class BlogController
11381138
{
@@ -1165,7 +1165,7 @@ the common configuration using options when importing the routes.
11651165
name_prefix: 'blog_'
11661166
# these requirements are added to all imported routes
11671167
requirements:
1168-
locale: 'en|es|fr'
1168+
_locale: 'en|es|fr'
11691169
# An imported route with an empty URL will become "/blog/"
11701170
# Uncomment this option to make that URL "/blog" instead
11711171
# trailing_slash_on_root: false
@@ -1188,7 +1188,7 @@ the common configuration using options when importing the routes.
11881188
prefix="/blog"
11891189
name-prefix="blog_">
11901190
<!-- these requirements are added to all imported routes -->
1191-
<requirement key="locale">en|es|fr</requirement>
1191+
<requirement key="_locale">en|es|fr</requirement>
11921192
</import>
11931193
11941194
<!-- An imported route with an empty URL will become "/blog/"
@@ -1215,7 +1215,7 @@ the common configuration using options when importing the routes.
12151215
// this is added to the beginning of all imported route names
12161216
->namePrefix('blog_')
12171217
// these requirements are added to all imported routes
1218-
->requirements(['locale' => 'en|es|fr'])
1218+
->requirements(['_locale' => 'en|es|fr'])
12191219
;
12201220
};
12211221

0 commit comments

Comments
 (0)