8000 minor #9314 [FrameworkBundle] feature: redirect query params too in R… · symfony/symfony-docs@836e3e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 836e3e6

Browse files
committed
minor #9314 [FrameworkBundle] feature: redirect query params too in RedirectController (Simperfit, javiereguiluz)
This PR was merged into the master branch. Discussion ---------- [FrameworkBundle] feature: redirect query params too in RedirectController Adding documentation for the redirectAction improvement. This needs the feature to be merged first Commits ------- ba5c343 Restored a removed character 6c92c05 Reworded the new option explanation 7210586 feature: redirect query params too in RedirectController
2 parents 1abac5c + ba5c343 commit 836e3e6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

routing/redirect_in_config.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ action:
113113
controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
114114
defaults:
115115
route: sonata_admin_dashboard
116+
# make a permanent redirection...
116117
permanent: true
118+
# ...and keep the original query string parameters
119+
keepQueryParams: true
117120
118121
.. code-block:: xml
119122
@@ -129,7 +132,10 @@ action:
129132
<route id="admin" path="/wp-admin">
130133
<default key="_controller">Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction</default>
131134
<default key="route">sonata_admin_dashboard</default>
135+
<!-- make a permanent redirection... -->
132136
<default key="permanent">true</default>
137+
<!-- ...and keep the original query string parameters -->
138+
<default key="keepQueryParams">true</default>
133139
</route>
134140
</routes>
135141
@@ -145,7 +151,10 @@ action:
145151
$routes->add('admin', new Route('/wp-admin', array(
146152
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction',
147153
'route' => 'sonata_admin_dashboard',
154+
// make a permanent redirection...
148155
'permanent' => true,
156+
// ...and keep the original query string parameters
157+
'keepQueryParams' => true,
149158
)));
150159
151160
return $routes;

0 commit comments

Comments
 (0)
0