Skip to content

Commit c70d200

Browse files
Simplified
1 parent e45736e commit c70d200

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

routing.rst

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ need for duplicate registration of routes which minimizes the risk for any bugs
211211
caused by definition inconsistency.
212212

213213
A common requirement for internationalized applications is to prefix all routes
214-
with a locale. This can be done by prefixing all your routes.
214+
with a locale. This can be done by defining a different prefix for each locale
215+
(and setting an empty prefix for your default locale if you prefer it):
215216

216217
.. configuration-block::
217218

@@ -222,22 +223,7 @@ with a locale. This can be done by prefixing all your routes.
222223
resource: '../src/Controller/'
223224
type: annotation
224225
prefix:
225-
en: '/en'
226-
fr: '/fr'
227-
es: '/es'
228-
229-
You can even have your default locale unprefixed:
230-
231-
.. configuration-block::
232-
233-
.. code-block:: yaml
234-
235-
# config/routes/annotations.yaml
236-
controllers:
237-
resource: '../src/Controller/'
238-
type: annotation
239-
prefix:
240-
en: '' # empty string (default locale)
226+
en: '' # don't prefix URLs for English, the default locale
241227
fr: '/fr'
242228
es: '/es'
243229

0 commit comments

Comments
 (0)