On Feb 12, 2011, at 2:45 PM, gelform wrote:

>               $messages = $flashMessenger->getMessages ();
>               
>               if ( $flashMessenger->hasCurrentMessages () )
>               {
>                       $messages = array_merge ( $messages, 
> $flashMessenger->getCurrentMessages
> () );
>                       $flashMessenger->clearCurrentMessages ();
>               }
> 
>               $view->messages = $messages;

So you collecting none or more messages from flashMessenger
If there are messages
  merge those messages we have in $messages with the same set of messages.
  clear the messages
store the messages or null in the view

Why not do this in the Bootstrap under _initFlashMessenger()

$fm = Zend_Controller_Action_HelperBroker::getStaticHelper("FlashMessenger');

if ( $fm->hasMessages() ) {
    
    $view = $this->getResource( 'view' );
    
    $view->messages = $fm->getMessages();
    
}

2nd paragraph 
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html

"There are a number of ways to use Action Helpers. Action Helpers employ the 
use of a brokerage system, similar to the types of brokerage you see in 
Zend_View_Helper, and that of Zend_Controller_Plugin. Action Helpers (like 
Zend_View_Helper) may be loaded and called on demand, or they may be 
instantiated at request time (bootstrap) or action controller creation time 
(init()). To understand this more fully, please see the usage section below."

Reply via email to