Skip to content

Instantly share code, notes, and snippets.

@wilful
Created February 13, 2012 12:43
Show Gist options
  • Save wilful/1816672 to your computer and use it in GitHub Desktop.
Save wilful/1816672 to your computer and use it in GitHub Desktop.
<?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