• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Controller_Action_Helper_FlashMessenger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Controller_Action_Helper_FlashMessenger的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action_Helper_FlashMessenger类的具体用法?PHP Zend_Controller_Action_Helper_FlashMessenger怎么用?PHP Zend_Controller_Action_Helper_FlashMessenger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Zend_Controller_Action_Helper_FlashMessenger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: preDispatch

 /**
  * Called before an action is dispatched by Zend_Controller_Dispatcher.
  *
  * This callback allows for proxy or filter behavior.  By altering the
  * request and resetting its dispatched flag (via
  * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  * the current action may be skipped.
  *
  * @param  Zend_Controller_Request_Abstract $request
  * @return void
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $oAuth = Zend_Auth::getInstance();
     $oAcl = $this->getAcl();
     // Default role
     $sRole = 'all';
     if ($oAuth->hasIdentity()) {
         $oIdentity = $oAuth->getIdentity();
         $sRole = isset($oIdentity->sRole) ? $oIdentity->sRole : 'identify';
     }
     $sModule = $request->module;
     $sController = $request->controller;
     $sAction = $request->action;
     $sResource = $sController . ':' . $sAction;
     if ($oAcl->has($sResource)) {
         if (!$oAcl->isAllowed('all', $sResource)) {
             // Access is not allowed
             if (!$oAcl->isAllowed($sRole, $sResource)) {
                 //$flashMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
                 //$flashMessenger->addMessage('Acesso negado');
                 $request->setModuleName('default');
                 $request->setControllerName('index');
                 $request->setActionName('index');
             }
         }
     } else {
         $flashMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
         $flashMessenger->addMessage('Acesso negado');
         $request->setModuleName('default');
         $request->setControllerName('index');
         $request->setActionName('index');
     }
 }
开发者ID:julioprotzek,项目名称:eventos,代码行数:44,代码来源:Acl.php


示例2: addMessage

 /**
  * addMessage() - Add a message to flash message
  *
  * @param  string $message
  * @param  string $namespace
  * @return LoSo_Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
  */
 public function addMessage($message, $namespace = null)
 {
     if (!empty($namespace)) {
         $this->setNamespace($namespace);
     }
     return parent::addMessage($message);
 }
开发者ID:nuxwin,项目名称:losolib,代码行数:14,代码来源:FlashMessenger.php


示例3: addMessage

 /**
  * addMessage() - Add a message to flash message
  *
  * @param  string $message
  * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
  */
 public function addMessage($message, $type = self::MSG_SUCCESS)
 {
     $msg = new stdClass();
     $msg->type = $type;
     $msg->message = $message;
     return parent::addMessage($msg);
 }
开发者ID:ncsuwebdev,项目名称:otframework,代码行数:13,代码来源:Messenger.php


示例4: indexAction

 public function indexAction()
 {
     $toolbar = new Statistics_Form_Toolbar();
     $options = $this->_helper->Options->getOptions($toolbar, $this->_user['clientid']);
     $params = $this->_helper->Params->getParams($toolbar, $options);
     $charts = new Statistics_Model_Charts();
     $charts->createCharts(13, 500, 300, $this->view->translate('STATISTICS_UNCATEGORIZED'), $params, $options);
     $quotesDb = new Sales_Model_DbTable_Quote();
     $quotes = $quotesDb->fetchAll($quotesDb->select()->where('quoteid = ?', 0)->order('id desc')->limit(5));
     $this->view->quotes = $quotes;
     $salesordersDb = new Sales_Model_DbTable_Salesorder();
     $salesorders = $salesordersDb->fetchAll($salesordersDb->select()->where('salesorderid = ?', 0)->order('id desc')->limit(5));
     $this->view->salesorders = $salesorders;
     $invoicesDb = new Sales_Model_DbTable_Invoice();
     $invoices = $invoicesDb->fetchAll($invoicesDb->select()->where('invoiceid = ?', 0)->order('id desc')->limit(5));
     $this->view->invoices = $invoices;
     $quoterequestsDb = new Purchases_Model_DbTable_Quoterequest();
     $quoterequests = $quoterequestsDb->fetchAll($quoterequestsDb->select()->where('quoterequestid = ?', 0)->order('id desc')->limit(5));
     $this->view->quoterequests = $quoterequests;
     $purchaseordersDb = new Purchases_Model_DbTable_Purchaseorder();
     $purchaseorders = $purchaseordersDb->fetchAll($purchaseordersDb->select()->where('purchaseorderid = ?', 0)->order('id desc')->limit(5));
     $this->view->purchaseorders = $purchaseorders;
     $this->view->options = $options;
     $this->view->toolbar = new Application_Form_Toolbar();
     $this->view->messages = $this->_flashMessenger->getMessages();
 }
开发者ID:dewawi,项目名称:dewawi,代码行数:26,代码来源:IndexController.php


示例5: checkAuth

 public function checkAuth()
 {
     if (!$this->isPublic() && !Zend_Auth::getInstance()->hasIdentity()) {
         $this->_flash->addMessage('You must be logged in');
         $this->_redirector->gotoSimple('login', 'account');
     }
 }
开发者ID:ajbrown,项目名称:bitnotion,代码行数:7,代码来源:Action.php


示例6: _flash

 /**
  * Uklada stavove zpravy
  *
  * @param string $message Zprava
  * @param const $status Status
  * @param bool $nextRequest Zobrazit hned, nebo az pri dalsim requestu
  */
 protected function _flash($message, $status, $nextRequest = true)
 {
     if ($nextRequest == false) {
         $this->view->flash = array('message' => $message, 'status' => $status);
     } else {
         $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
         $this->_flashMessenger->addMessage(array('message' => $message, 'status' => $status));
     }
 }
开发者ID:besters,项目名称:My-Base,代码行数:16,代码来源:Action.php


示例7: testClearMessages

 public function testClearMessages()
 {
     $this->helper->addMessage('foo');
     $this->helper->addMessage('bar');
     $this->assertTrue($this->helper->hasMessages());
     $this->assertEquals(2, count($this->helper));
     $this->helper->clearMessages();
     $this->assertFalse($this->helper->hasMessages());
     $this->assertEquals(0, count($this->helper));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:10,代码来源:FlashMessengerTest.php


示例8: authenticateAction

 public function authenticateAction()
 {
     try {
         $user = Pocs_User::login($this->getRequest()->getParam('un'), $this->getRequest()->getParam('pw'), $this->_getAuth(), $this->_getAcl());
     } catch (Exception $e) {
         $this->_flashMessenger->addMessage($e->getMessage());
         $this->_helper->redirector('index', 'login');
     }
     $this->_flashMessenger->addMessage(Zend_Debug::dump($user, 'Authenticated User', false));
     //TODO: Redirect somewhere useful..
     $this->_helper->redirector('index', 'login');
 }
开发者ID:stm555,项目名称:proof-of-concepts,代码行数:12,代码来源:LoginController.php


示例9: searchAction

 public function searchAction()
 {
     $this->_helper->viewRenderer->setRender('index');
     $this->_helper->getHelper('layout')->disableLayout();
     $lenght = $this->_getParam('lenght', 25);
     $toolbar = new Statistics_Form_Toolbar();
     $options = $this->_helper->Options->getOptions($toolbar, $this->_user['clientid']);
     $params = $this->_helper->Params->getParams($toolbar, $options);
     $chart = new Statistics_Model_Charts();
     $chart->createCharts($lenght, 1000, 400, $this->view->translate("STATISTICS_UNCATEGORIZED"), $params, $options);
     $this->view->lenght = $lenght;
     $this->view->options = $options;
     $this->view->toolbar = $toolbar;
     $this->view->messages = $this->_flashMessenger->getMessages();
 }
开发者ID:dewawi,项目名称:dewawi,代码行数:15,代码来源:IndexController.php


示例10: addMessage

 /**
  * Agrega un mensaje
  *
  * @param string $message Mensaje a mostrar en pantalla
  * @param string $level   Nivel del mensaje
  *
  * @return void
  */
 public function addMessage($message, $level = self::INFO)
 {
     $msg = new stdClass();
     $msg->message = $message;
     $msg->level = $level;
     parent::addMessage($msg);
 }
开发者ID:luismayta,项目名称:zrt,代码行数:15,代码来源:MyFlashMessenger.php


示例11: postDispatch

 /**
  * Events after the controller dispatching
  */
 public function postDispatch()
 {
     $infoProfiler = '';
     //-------------------------
     $request = $this->getRequest();
     if ($this->_breadcrumbs) {
         $this->view->breadcrumbs = $this->_breadcrumbs;
         $this->view->title = $this->_breadcrumbs->getTitle();
     }
     //Передадим признак Ajax запроса
     $this->view->isAjaxRequest = $this->_isAjaxRequest;
     //Передадим сообщения в шаблоны
     $this->view->messages = $this->_flashMessenger->getMessages();
     // Запомним время выполения цикла диспетчеризации
     $params = $request->getParams();
     foreach ($params as $key => $value) {
         if (!is_string($value)) {
             continue;
         }
         if ($infoProfiler) {
             $infoProfiler .= "{$key} = {$value}<br>";
         } else {
             $infoProfiler .= $this->Translate("Время выполнения запроса") . ":<br />{$key} = {$value}<br />";
         }
     }
     $infoProfiler .= "<br />" . $this->Translate("Равно") . " = ";
     Default_Plugin_SysBox::profilerTime2Registry($this->_startTimeDispatch, $infoProfiler);
 }
开发者ID:bsa-git,项目名称:zf-myblog,代码行数:31,代码来源:BaseController.php


示例12: testDirectProxiesToAddMessage

 public function testDirectProxiesToAddMessage()
 {
     $this->markTestSkipped();
     $this->helper->direct('foo');
     $this->assertTrue($this->helper->hasMessages());
     $this->assertEquals(1, count($this->helper));
 }
开发者ID:stunti,项目名称:zf2,代码行数:7,代码来源:FlashMessengerTest.php


示例13: verifyEmailAction

 public function verifyEmailAction()
 {
     $user_id = (int) $this->getRequest()->getParam('id');
     $guid = (string) $this->getRequest()->getParam('guid');
     if (!empty($user_id) && !empty($guid)) {
         $model = new Model_User();
         $model = $model->find($user_id);
         if ($model->getEnabled()) {
             $this->_flashMessenger->addMessage("Your account has already been activated, you can now Login.");
             $this->_redirect('/user/login/');
             return;
         }
         if ($guid == hash('sha1', $model->getSalt() . $model->getId() . $model->getPassword())) {
             $model->setEnabled(1);
             $model->setEmailVerified(1);
             $model->save();
             $this->user = $model;
             $this->_flashMessenger->addMessage("Thanks for activating your account, you can now Login.");
             $this->_redirect('/user/login/');
             return;
         } else {
             $this->_redirect('/user/register/');
             return;
         }
     } else {
         $this->_redirect('/');
     }
 }
开发者ID:Zerone,项目名称:ImJob.org,代码行数:28,代码来源:UserController.php


示例14: addAction

 public function addAction()
 {
     $form = new Front_Form_Contact();
     if ($this->_request->isPost()) {
         $data = $this->_request->getPost();
         if ($form->isValid($data)) {
             $dataFiltrees = $form->getValues();
             $contact = new Application_Model_Contact();
             $contact->setPrenom($dataFiltrees['prenom'])->setNom($dataFiltrees['nom'])->setEmail($dataFiltrees['email'])->setTelephone($dataFiltrees['telephone']);
             $this->mapper->insert($contact);
             $this->_flashMessenger->addMessage('Le contact ' . $contact->getPrenom() . ' a bien été créé');
             $this->_redirector->gotoRouteAndExit(['controller' => 'contact'], null, true);
         }
     }
     $this->view->contactForm = $form;
 }
开发者ID:bioub,项目名称:Formation_ZF1_Viveris_2016_02,代码行数:16,代码来源:ContactController.php


示例15: viewAction

 /**
  * View feed information
  * 
  * @return void
  */
 public function viewAction()
 {
     //get flash messages
     $this->view->messages = $this->_flashMessenger->getMessages();
     $id = $this->getRequest()->getParam('id');
     //get feedinfo
     $feeds = new Feeds();
     $this->view->feed = $feeds->getBySlug($id);
     if (!$this->view->feed) {
         throw new Zend_Exception('Feed doesn\'t exist');
     }
     $this->view->feed->views++;
     $this->view->feed->save();
     //get posts
     $limit = 5;
     $page = $this->getRequest()->getParam('page') ? $this->getRequest()->getParam('page') : 1;
     $posts = new Posts();
     $this->view->posts = $posts->getByFeedId($this->view->feed->id, $page, $limit);
     $total = $posts->getByFeedId($this->view->feed->id, $page, 0, true)->total;
     $this->view->paginator = Zend_Paginator::factory($total);
     $this->view->paginator->setCurrentPageNumber($page);
     $this->view->paginator->setItemCountPerPage($limit);
     $this->view->keywords = implode('', array('ifphp', 'news aggragator', 'support,' . $this->view->feed->title));
     $this->view->description = 'ifPHP, The PHP news Aggragator: ' . $this->view->feed->description;
 }
开发者ID:aprondak,项目名称:ifphp,代码行数:30,代码来源:FeedController.php


示例16: deleteAction

 public function deleteAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper('layout')->disableLayout();
     if ($this->getRequest()->isPost()) {
         $id = $this->_getParam('id', 0);
         $contactDb = new Contacts_Model_DbTable_Contact();
         $contactDb->deleteContact($id);
         $phoneDb = new Contacts_Model_DbTable_Phone();
         $phones = $phoneDb->getPhone($id);
         foreach ($phones as $phone) {
             $phoneDb->deletePhone($phone['id']);
         }
         $emailDb = new Contacts_Model_DbTable_Email();
         $emails = $emailDb->getEmail($id);
         foreach ($emails as $email) {
             $emailDb->deleteEmail($email['id']);
         }
         $internetDb = new Contacts_Model_DbTable_Internet();
         $internets = $internetDb->getInternet($id);
         foreach ($internets as $internet) {
             $internetDb->deleteInternet($internet['id']);
         }
     }
     $this->_flashMessenger->addMessage('MESSAGES_SUCCESFULLY_DELETED');
 }
开发者ID:dewawi,项目名称:dewawi,代码行数:26,代码来源:ContactController.php


示例17: getMessages

 /**
  * The curent flash messenger messages
  *
  * @return array
  */
 protected function getMessages()
 {
     if (!$this->_messenger instanceof \MUtil_Controller_Action_Helper_FlashMessenger) {
         $this->_messenger = new \MUtil_Controller_Action_Helper_FlashMessenger();
     }
     return $this->_messenger->getMessagesOnly();
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:12,代码来源:AccessLog.php


示例18: addMessage

 /**
  * Add a message with a status
  * @param string|array     $message   The message to add. You can group Messages in one status by passing them as an Array
  * @param string $status    The status to add to the message, one of: success, info, warning or danger
  * @param string $namespace The messages namespace
  */
 public function addMessage($message, $status = null, $namespace = null)
 {
     if (!$status) {
         $status = $this->_defaultStatus;
     }
     $message = array($message, $status);
     parent::addMessage($message, $namespace);
     return $this;
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:15,代码来源:FlashMessenger.php


示例19: __construct

 /**
  * __construct() - Instance constructor, needed to get iterators, etc
  *
  * @param  string $namespace
  * @return void
  */
 public function __construct()
 {
     if (!self::$_session instanceof Zend_Session_Namespace) {
         self::$_session = new Zend_Session_Namespace($this->getName());
         foreach (self::$_session as $namespace => $messages) {
             self::$_messages[$namespace] = $messages;
             unset(self::$_session->{$namespace});
         }
     }
 }
开发者ID:Nerutiz,项目名称:trades,代码行数:16,代码来源:FlashMessenger.php


示例20: 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();
 }
开发者ID:Neozeratul,项目名称:Intermodels,代码行数:16,代码来源:NeoFlashMessenger.php



注:本文中的Zend_Controller_Action_Helper_FlashMessenger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Controller_Action_Helper_ViewRenderer类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Controller_Action_HelperBroker类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap