File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
132
132
and ``redirect() `` methods::
133
133
134
134
use Symfony\Component\HttpFoundation\RedirectResponse;
135
- use Symfony\Component\HttpFoundation\Response
135
+ use Symfony\Component\HttpFoundation\Response;
136
136
137
137
// ...
138
138
public function index(): RedirectResponse
@@ -153,6 +153,9 @@ and ``redirect()`` methods::
153
153
154
154
// redirects to a route and maintains the original query string parameters
155
155
return $this->redirectToRoute('blog_show', $request->query->all());
156
+
157
+ // redirects to the current route (e.g. for Post/Redirect/Get pattern):
158
+ return $this->redirectToRoute($request->attributes->get('_route'));
156
159
157
160
// redirects externally
158
161
return $this->redirect('http://symfony.com/doc');
You can’t perform that action at this time.
0 commit comments