File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1146,6 +1146,18 @@ special parameters created by Symfony:
1146
1146
``_locale ``
1147
1147
Used to set the :ref: `locale <translation-locale-url >` on the request.
1148
1148
1149
+ ``_query ``
1150
+ Used to add query parameters to the generated URL.
1151
+
1152
+ .. versionadded :: 7.4
1153
+
1154
+ The ``_query `` parameter was introduced in Symfony 7.4.
1155
+
1156
+ .. deprecated :: 7.4
1157
+
1158
+ Passing a value other than an array as the ``_query `` parameter was
1159
+ deprecated in Symfony 7.4.
1160
+
1149
1161
You can include these attributes (except ``_fragment ``) both in individual routes
1150
1162
and in route imports. Symfony defines some special attributes with the same name
1151
1163
(except for the leading underscore) so you can define them easier:
@@ -1164,6 +1176,7 @@ and in route imports. Symfony defines some special attributes with the same name
1164
1176
path: '/articles/{_locale}/search.{_format}',
1165
1177
locale: 'en',
1166
1178
format: 'html',
1179
+ query: ['page' => 1],
1167
1180
requirements: [
1168
1181
'_locale' => 'en|fr',
1169
1182
'_format' => 'html|xml',
@@ -1182,6 +1195,8 @@ and in route imports. Symfony defines some special attributes with the same name
1182
1195
controller : App\Controller\ArticleController::search
1183
1196
locale : en
1184
1197
format : html
1198
+ query :
1199
+ page : 1
1185
1200
requirements :
1186
1201
_locale : en|fr
1187
1202
_format : html|xml
@@ -1219,6 +1234,7 @@ and in route imports. Symfony defines some special attributes with the same name
1219
1234
->controller([ArticleController::class, 'search'])
1220
1235
->locale('en')
1221
1236
->format('html')
1237
+ ->query(['page' => 1])
1222
1238
->requirements([
1223
1239
'_locale' => 'en|fr',
1224
1240
'_format' => 'html|xml',
You can’t perform that action at this time.
0 commit comments