Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d6704c

Browse files
authored
Update redirect_in_config.rst
1 parentc4ff989 commit8d6704c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎routing/redirect_in_config.rst‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Redirecting Using a Route
9696

9797
Assume you are migrating your website from WordPress to Symfony, you want to
9898
redirect ``/wp-admin`` to the route ``sonata_admin_dashboard``. You don't know
99-
the path, only the route name, if you pass query parameters to this route, it will be redirected too. This can be achieved using the
99+
the path, only the route name, if you pass query parameters to this route and active the ``keepQueryParams``, it will be redirected too. This can be achieved using the
100100
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::redirectAction`
101101
action:
102102

@@ -114,6 +114,7 @@ action:
114114
defaults:
115115
route:sonata_admin_dashboard
116116
permanent:true
117+
keepQueryParams:true
117118
118119
..code-block::xml
119120
@@ -130,6 +131,7 @@ action:
130131
<defaultkey="_controller">Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction</default>
131132
<defaultkey="route">sonata_admin_dashboard</default>
132133
<defaultkey="permanent">true</default>
134+
<defaultkey="keepQueryParams">true</default>
133135
</route>
134136
</routes>
135137
@@ -146,6 +148,7 @@ action:
146148
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction',
147149
'route' => 'sonata_admin_dashboard',
148150
'permanent' => true,
151+
'keepQueryParams' => true
149152
)));
150153
151154
return $collection;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp