My controller has just finished dealing with a form, and
if ($form->isValid())
{
// Persist my data.
// ...
// Now move on to the next page.
return $this->redirectToRoute('page2');
}
But I would like to pass variable to that page using POST. I.e. something similar to:
$this->redirectToRoute('page2', array('state' => 'wonderful'));
This will obviously pass it as a GET parameter. People have suggested using redirect 307s and forwarding, but they just forward the current request along. What I need to do is create a new Request with my arbitrary message. How can I accomplish this?