Reputation: 375
In my case, I have a small form with login and password, once submitted, the login/pass are used to open an imap conn to retrieve the user's emails, once the array of emails retrieved in the same action, I want to redirect to another action that uses this array for other treatements !
How is that possible? I mean redirection to another action and sending the whole array as post parameter ?
Upvotes: 2
Views: 19118
Reputation: 1696
Why not put in session? Either $user->setAttribute()
or $user->setFlash()
Upvotes: 1
Reputation: 2562
You should use a $this->forward()
method $this->getRequest()->setParameter()
and in the action.
For example:
in the first action:
$this->getRequest()->setParameter('emails',array('[email protected]','[email protected]','[email protected]'));
$this->forward('anotherModule','anotherAction');
in the another action:
print_r($this->getRequest()->getParameter('emails'));
Upvotes: 10