Skip to content

Commit f7e869e

Browse files
committed
minor #10373 Mentioned how to redirect and maintain the query string (javiereguiluz)
This PR was merged into the 2.8 branch. Discussion ---------- Mentioned how to redirect and maintain the query string This fixes symfony/symfony#27482. Commits ------- 71d6ab1 Mentioned how to redirect and maintain the query string
2 parents c0ba800 + 71d6ab1 commit f7e869e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

controller.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ and ``redirect()`` methods::
176176
// redirects to a route with parameters
177177
return $this->redirectToRoute('blog_show', array('slug' => 'my-page'));
178178

179+
// redirects to a route and mantains the original query string parameters
180+
return $this->redirectToRoute('blog_show', $request->query->all());
181+
179182
// redirects externally
180183
return $this->redirect('http://symfony.com/doc');
181184
}

0 commit comments

Comments
 (0)