File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,8 @@ need for duplicate registration of routes which minimizes the risk for any bugs
211211caused by definition inconsistency.
212212
213213A 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
You can’t perform that action at this time.
0 commit comments