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:
11461146``_locale ``
11471147 Used to set the :ref: `locale <translation-locale-url >` on the request.
11481148
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+
11491161You can include these attributes (except ``_fragment ``) both in individual routes
11501162and in route imports. Symfony defines some special attributes with the same name
11511163(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
11641176 path: '/articles/{_locale}/search.{_format}',
11651177 locale: 'en',
11661178 format: 'html',
1179+ query: ['page' => 1],
11671180 requirements: [
11681181 '_locale' => 'en|fr',
11691182 '_format' => 'html|xml',
@@ -1182,6 +1195,8 @@ and in route imports. Symfony defines some special attributes with the same name
11821195 controller : App\Controller\ArticleController::search
11831196 locale : en
11841197 format : html
1198+ query :
1199+ page : 1
11851200 requirements :
11861201 _locale : en|fr
11871202 _format : html|xml
@@ -1219,6 +1234,7 @@ and in route imports. Symfony defines some special attributes with the same name
12191234 ->controller([ArticleController::class, 'search'])
12201235 ->locale('en')
12211236 ->format('html')
1237+ ->query(['page' => 1])
12221238 ->requirements([
12231239 '_locale' => 'en|fr',
12241240 '_format' => 'html|xml',
You can’t perform that action at this time.
0 commit comments