本文整理汇总了PHP中Zend_Controller_Action_Helper_FlashMessenger::getCurrentMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action_Helper_FlashMessenger::getCurrentMessages方法的具体用法?PHP Zend_Controller_Action_Helper_FlashMessenger::getCurrentMessages怎么用?PHP Zend_Controller_Action_Helper_FlashMessenger::getCurrentMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action_Helper_FlashMessenger
的用法示例。
在下文中一共展示了Zend_Controller_Action_Helper_FlashMessenger::getCurrentMessages方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchAction
public function searchAction()
{
$this->_helper->viewRenderer->setRender('index');
$this->_helper->getHelper('layout')->disableLayout();
$toolbar = new Sales_Form_Toolbar();
$options = $this->_helper->Options->getOptions($toolbar, $this->_user['clientid']);
$params = $this->_helper->Params->getParams($toolbar, $options);
$quotes = $this->search($params, $options['categories']);
$this->view->quotes = $quotes;
$this->view->options = $options;
$this->view->toolbar = $toolbar;
$this->view->messages = array_merge($this->_flashMessenger->getMessages(), $this->_flashMessenger->getCurrentMessages());
$this->_flashMessenger->clearCurrentMessages();
}
示例2: getCurrentMessages
/**
* getCurrentMessages() - get messages that have been added to the current
* namespace within this request
*
* @return array
*/
public function getCurrentMessages($type = null)
{
if ($type === null) {
return parent::getCurrentMessages();
}
if (isset(self::$_session->{$this->_namespace}[$type])) {
return self::$_session->{$this->_namespace}[$type];
}
return array();
}
示例3: testRemoveMessageToCustomNamespace
/**
* @group ZF-1705
*/
public function testRemoveMessageToCustomNamespace()
{
// Place a message in foobar and default namespaces
$this->helper->addMessage('testmessage', 'foobar');
$this->assertTrue($this->helper->hasCurrentMessages('foobar'));
$this->helper->addMessage('defaultmessage');
$this->assertTrue($this->helper->hasCurrentMessages());
// Erase the foobar namespace
$this->helper->clearCurrentMessages('foobar');
// Ensure it cleared the specified namespace
$foobarMessages = $this->helper->getCurrentMessages('foobar');
$this->assertTrue(empty($foobarMessages), 'Namespace foobar not empty');
// Ensure it didnt' clear the default namespace
$defaultMessages = $this->helper->getCurrentMessages();
$this->assertEquals(1, count($defaultMessages));
$this->assertEquals('defaultmessage', array_pop($defaultMessages));
}
示例4: searchAction
public function searchAction()
{
$this->_helper->viewRenderer->setRender('index');
$this->_helper->getHelper('layout')->disableLayout();
$toolbar = new Processes_Form_Toolbar();
$options = $this->_helper->Options->getOptions($toolbar, $this->_user['clientid']);
$params = $this->_helper->Params->getParams($toolbar, $options);
$processes = $this->search($params, $options['categories']);
//Get positions
$processIDs = array();
foreach ($processes as $process) {
array_push($processIDs, $process['id']);
}
$this->view->processes = $processes;
$this->view->options = $options;
$this->view->toolbar = $toolbar;
$this->view->positions = $this->getPositions($processIDs);
$this->view->paymentstatus = $this->_helper->PaymentStatus->getPaymentStatus();
$this->view->deliverystatus = $this->_helper->DeliveryStatus->getDeliveryStatus();
$this->view->supplierorderstatus = $this->_helper->SupplierOrderStatus->getSupplierOrderStatus();
$this->view->messages = array_merge($this->_flashMessenger->getMessages(), $this->_flashMessenger->getCurrentMessages());
$this->_flashMessenger->clearCurrentMessages();
}
示例5: hasMessages
/**
* Contrôle de l'existance ou non de messages dans la pile
*
* @return int
*/
public function hasMessages()
{
return count($this->flashMessenger) + count($this->flashMessenger->getCurrentMessages());
}