Jaka Jančar wrote:
> 
> Have you tried the FlashMessenger?
> 

Awesome, thanks.  FlashMessenger was just what I needed.

application/modules/default/controllers/ProfileController.php
  function init()
  {
    parent::init();
  
    $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
    $this->view->flash_messages = $this->_flashMessenger->getMessages();
  }
  
  function editAction()
  {
    if ($this->Users->editProfile($this->form)) {
      $this->_flashMessenger->addMessage('Profile updated.');
      $this->_redirect($this->_listpage);
    }
  }

application/layouts/layout.phtml
  print_r($this->flash_messages);

That's it.  Pretty simple.  Also it is nice to add a view helper as well...

application/modules/default/views/helpers/FlashMessages.php
class Zend_View_Helper_FlashMessages
{
  public $view;

  public function setView ( Zend_View_Interface $view )
  {
      $this->view = $view;
  }

  public function FlashMessages ( )
  {
      return print_r($this->view->flash_messages, true);
  }
}

application/layouts/layout.phtml
  echo $this->flashMessages();

-- 
View this message in context: 
http://www.nabble.com/Inter-page-messaging---How-do-I-display-information-in-my-layout--tp19408777p19412751.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to