Created
March 15, 2010 20:54
-
-
Save ericclemmons/333323 to your computer and use it in GitHub Desktop.
Zend Framework FlashMessenger Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* GetMessages | |
* | |
* @author Eric Clemmons ([email protected]) | |
* @category Zend | |
* @package Zend_View | |
* @subpackage Helper | |
* | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
* | |
*/ | |
/** | |
* @see Zend_View_Helper_Abstract | |
*/ | |
class Zend_View_Helper_GetMessages extends Zend_View_Helper_Abstract | |
{ | |
public function getMessages() | |
{ | |
$messenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger'); | |
// Return previous session's messages (as FlashMessenger intends) or pull messages | |
// from the current session. | |
return $messenger->getMessages() ?: $messenger->getCurrentMessages(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment