当前位置: 首页>>代码示例>>PHP>>正文


PHP AbstractActionController::attachDefaultListeners方法代码示例

本文整理汇总了PHP中Zend\Mvc\Controller\AbstractActionController::attachDefaultListeners方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractActionController::attachDefaultListeners方法的具体用法?PHP AbstractActionController::attachDefaultListeners怎么用?PHP AbstractActionController::attachDefaultListeners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Mvc\Controller\AbstractActionController的用法示例。


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

示例1: attachDefaultListeners

 /**
  * Register the default events for this controller
  *
  * @return void
  */
 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $events = $this->getEventManager();
     $events->attach('dispatch', array($this, 'initJsController'), -10);
     $events->attach('dispatch', array($this->getJsLoader(), 'onMvcDispatch'), -90);
 }
开发者ID:codeliner,项目名称:codelinerjs,代码行数:12,代码来源:AbstractAppController.php

示例2: attachDefaultListeners

 /**
  * Se encarga de colgar las funciones predispatch y post dispatch para ser ejecutados
  * antes y despues del controlador principal y poder realizar tareas comunes de 
  * inicializacion y post procesamiento  
  * @see \Zend\Mvc\Controller\AbstractController::attachDefaultListeners()
  */
 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $events = $this->getEventManager();
     $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 100);
     $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'postDispatch'), -100);
 }
开发者ID:mrkz8,项目名称:kratos-finder,代码行数:13,代码来源:AppAbstractController.php

示例3: attachDefaultListeners

 public function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $events = $this->getEventManager();
     /* This must run before onDispatch, because we could alter the action param */
     $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'checkPostRequest'), 10);
     return $this;
 }
开发者ID:bitrecruiter,项目名称:CrossApplicantManager,代码行数:8,代码来源:ManageController.php

示例4: attachDefaultListeners

 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     /**
      * @todo Think of how we can automatically redirect to allow page if user hasn't installed
      */
     $this->events->attach('dispatch', array($this, 'preDispatch'), 100);
 }
开发者ID:elyobelyob,项目名称:zfcfacebook,代码行数:8,代码来源:AbstractIframeController.php

示例5: attachDefaultListeners

 /**
  * attaches further Listeners for generating / processing the output
  *
  * @return $this
  */
 public function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $serviceLocator = $this->getServiceLocator();
     $defaultServices = $serviceLocator->get('DefaultListeners');
     $events = $this->getEventManager();
     $events->attach($defaultServices);
     return $this;
 }
开发者ID:webpants,项目名称:YAWIK,代码行数:14,代码来源:IndexController.php

示例6: attachDefaultListeners

 /**
  * Register the default events for this controller
  *
  * @return void
  */
 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     // Attach preDispatch event if we need to check permissions.
     if ($this->accessPermission) {
         $events = $this->getEventManager();
         $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'preDispatch'], 1000);
     }
 }
开发者ID:ajones3066,项目名称:vufind,代码行数:14,代码来源:AbstractBase.php

示例7: attachDefaultListeners

 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $events = $this->getEventManager();
     $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
     $serviceLocator = $this->getServiceLocator();
     $defaultServices = $serviceLocator->get('DefaultListeners');
     $events->attach($defaultServices);
 }
开发者ID:utrenkner,项目名称:YAWIK,代码行数:9,代码来源:FileController.php

示例8: attachDefaultListeners

 /**
  * Register the default events for this controller
  *
  * @internal
  *      Registers two hooks on "onDispatch":
  *      - change action to form and set mode parameter
  *      - inject sidebar navigation
  */
 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $events = $this->getEventManager();
     /*
      * "Redirect" action 'new' and 'edit' to 'form' and set the 
      * route parameter 'mode' to the original action.
      * This must run before onDispatch, because we alter the action param 
      */
     $events->attach(MvcEvent::EVENT_DISPATCH, function ($event) {
         $routeMatch = $event->getRouteMatch();
         $action = $routeMatch->getParam('action');
         if ('new' == $action || 'edit' == $action) {
             $routeMatch->setParam('mode', $action);
             $routeMatch->setParam('action', 'form');
         }
     }, 10);
     /*
      * Inject a sidebar view model in the Layout-Model, if 
      * the result in the event is not terminal.
      * This must run after "InjectViewModelListener", which runs with
      * a priority of -100.
      */
     $events->attach(MvcEvent::EVENT_DISPATCH, function ($event) {
         $model = $event->getResult();
         if (!$model instanceof ViewModel || $model->terminate()) {
             return;
         }
         $routeMatch = $event->getRouteMatch();
         $action = $routeMatch->getParam('action');
         if ('form' == $action) {
             $action = $routeMatch->getParam('mode');
         }
         $layout = $event->getViewModel();
         $sidebar = new ViewModel();
         $sidebar->setVariable('action', $action);
         $sidebar->setTemplate('auth/sidebar/groups-menu');
         $layout->addChild($sidebar, 'sidebar_auth_groups-menu');
     }, -110);
     $serviceLocator = $this->getServiceLocator();
     $defaultServices = $serviceLocator->get('DefaultListeners');
     $events->attach($defaultServices);
 }
开发者ID:utrenkner,项目名称:YAWIK,代码行数:51,代码来源:ManageGroupsController.php

示例9: attachDefaultListeners

 /**
  * Attache les évènements
  *
  * @see \Zend\Mvc\Controller\AbstractController::attachDefaultListeners()
  */
 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $events = $this->getEventManager();
     $events->attach('dispatch', array($this, 'preDispatch'), 100);
 }
开发者ID:dsi-agpt,项目名称:minibus,代码行数:11,代码来源:IndexController.php

示例10: attachDefaultListeners

 /**
  * @return void
  */
 protected function attachDefaultListeners()
 {
     parent::attachDefaultListeners();
     $this->events->attach('dispatch', array($this, 'preDispatch'), 100);
     $this->events->attach('dispatch', array($this, 'postDispatch'), -100);
 }
开发者ID:dotuancd,项目名称:secretary,代码行数:9,代码来源:ActionController.php


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