Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony redirect with 2 parameters

How can I redirect to another action passing 2 or more parameters?

This code:

$this->redirect('input/new?year=' . $year . '&month=' . $month); 

Results in URL:

http://.../input?year=2009&month=9

like image 990
kipelovets Avatar asked Sep 30 '09 09:09

kipelovets


1 Answers

Well, that's normal, "redirect" redirect to an absolute URL. You can do that:

$this->redirect($this->generateUrl('default', array('module' => 'input', 'action' => 'new', 'year' => $year, 'month' => $month))); 
like image 168
xarch Avatar answered Sep 28 '22 02:09

xarch