2010年10月21日星期四

Re: [fw-mvc] Passing Array from One Controller to Another

Flash messenger isn't a bad idea. It's already designed to work within
controllers and has a built-in auto-destroy feature after 1 hop. It also
supports arrays or objects that can be serialized.

So if you're redirecting, the first request would set the data:

$myArray = array(/* ... */);
$this->_helper->flashMessenger->addMessage($myArray);

In the following request you can pull it:

$messages = $this->_helper->flashMessenger->getMessages();
$myArray = $messages[0];

--
*Hector Virgen*
Sr. Web Developer
Walt Disney Parks and Resorts Online
http://www.virgentech.com

没有评论: