Created
February 13, 2012 12:43
-
-
Save wilful/1816672 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* | |
*/ | |
/** | |
* Хелпер, отображающий flash-сообщения | |
*/ | |
class Workset_View_Helper_FlashMessenger extends Zend_View_Helper_Abstract { | |
/** | |
* | |
* @return string | |
*/ | |
public function flashMessenger($scriptName = null) { | |
$messages = Zend_Controller_Action_HelperBroker::getStaticHelper('flashMessenger')->getMessages(); | |
if (count($messages) && null !== $this->view) { | |
ob_start(); | |
if ($scriptName) { | |
echo $this->view->partial($scriptName, array('messages' => $messages)); | |
} else { | |
?> | |
<ul> | |
<? foreach ($messages as $message) { ?> | |
<li><?= $message ?></li> | |
<? } ?> | |
</ul> | |
<? | |
} | |
return ob_get_clean(); | |
} | |
return ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment