@@ -1151,6 +1151,13 @@ special parameters created by Symfony:
1151
1151
This is used for such things as setting the ``Content-Type `` of the response
1152
1152
(e.g. a ``json `` format translates into a ``Content-Type `` of ``application/json ``).
1153
1153
1154
+ ``_fragment ``
1155
+ Used to set the fragment identifier, which is the optional last part of a URL that
1156
+ starts with a ``# `` character and is used to identify a portion of a document.
1157
+
1158
+ ``_locale ``
1159
+ Used to set the :ref: `locale <translation-locale-url >` on the request.
1160
+
1154
1161
``_query ``
1155
1162
Used to add query parameters to the generated URL.
1156
1163
@@ -1160,14 +1167,8 @@ special parameters created by Symfony:
1160
1167
1161
1168
.. deprecated :: 7.4
1162
1169
1163
- Passing a value other than an array as the ``_query `` parameter was deprecated in Symfony 7.4.
1164
-
1165
- ``_fragment ``
1166
- Used to set the fragment identifier, which is the optional last part of a URL that
1167
- starts with a ``# `` character and is used to identify a portion of a document.
1168
-
1169
- ``_locale ``
1170
- Used to set the :ref: `locale <translation-locale-url >` on the request.
1170
+ Passing a value other than an array as the ``_query `` parameter was
1171
+ deprecated in Symfony 7.4.
1171
1172
1172
1173
You can include these attributes (except ``_fragment ``) both in individual routes
1173
1174
and in route imports. Symfony defines some special attributes with the same name
@@ -1187,6 +1188,7 @@ and in route imports. Symfony defines some special attributes with the same name
1187
1188
path: '/articles/{_locale}/search.{_format}',
1188
1189
locale: 'en',
1189
1190
format: 'html',
1191
+ query: ['page' => 1],
1190
1192
requirements: [
1191
1193
'_locale' => 'en|fr',
1192
1194
'_format' => 'html|xml',
@@ -1205,6 +1207,8 @@ and in route imports. Symfony defines some special attributes with the same name
1205
1207
controller : App\Controller\ArticleController::search
1206
1208
locale : en
1207
1209
format : html
1210
+ query :
1211
+ page : 1
1208
1212
requirements :
1209
1213
_locale : en|fr
1210
1214
_format : html|xml
@@ -1242,6 +1246,7 @@ and in route imports. Symfony defines some special attributes with the same name
1242
1246
->controller([ArticleController::class, 'search'])
1243
1247
->locale('en')
1244
1248
->format('html')
1249
+ ->query(['page' => 1])
1245
1250
->requirements([
1246
1251
'_locale' => 'en|fr',
1247
1252
'_format' => 'html|xml',
0 commit comments