Reputation: 23
I want to submit some data in post method when redirecting to another page. The solution coming in my mind is-
Is there any other method to do it or something native to Symfony2? Like for example when using redirect method in Symfony can I send some data in post method along it?
Upvotes: 1
Views: 1864
Reputation: 1764
Why dont you use sessions to store values before redirecting, this will be much easier
// Set a session value
$session = $this->getRequest()->getSession();
$session->set('session name', 'session value');
// redirect
$this->redirect('redirect to somewhere');
get the session value after redirecting
$value = $session->get('session name');
Upvotes: 2