[Phpwm] Zend Framework - FlashMessenger

Peter Measham pmeasham at gmail.com
Mon Jul 16 14:05:31 BST 2007


I use flash messenger like this:

<?php

class IndexController extends Zend_Controller_Action {

 	    public function init() {
 	        $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
 	        $this->view->messages = $this->_flashMessenger->getMessages();
 	    }

 	    public function indexAction() {

 	    }

 	    public function sectionAction() {
 	            $this->_flashMessenger->addMessage('Invalid Section');
 	            $this->_redirect('/');
 	    }

}

?>

Then in the header template:

<?php echo (isset($messages[0]))? $messages[0]: ""; ?>

Peter



More information about the Phpwm mailing list