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
211
211
caused by definition inconsistency.
212
212
213
213
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):
215
216
216
217
.. configuration-block ::
217
218
@@ -222,22 +223,7 @@ with a locale. This can be done by prefixing all your routes.
222
223
resource : ' ../src/Controller/'
223
224
type : annotation
224
225
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
241
227
fr : ' /fr'
242
228
es : ' /es'
243
229
You can’t perform that action at this time.
0 commit comments