From 71d6ab1fa87bc087277e56726f8d31dd2c02d3ad Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 21 Sep 2018 09:49:14 +0200 Subject: [PATCH] Mentioned how to redirect and maintain the query string --- controller.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller.rst b/controller.rst index 70b6ed7f290..e406d2a1e38 100644 --- a/controller.rst +++ b/controller.rst @@ -176,6 +176,9 @@ and ``redirect()`` methods:: // redirects to a route with parameters return $this->redirectToRoute('blog_show', array('slug' => 'my-page')); + // redirects to a route and mantains the original query string parameters + return $this->redirectToRoute('blog_show', $request->query->all()); + // redirects externally return $this->redirect('http://symfony.com/doc'); }