當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EventManagerInterface::attach方法代碼示例

本文整理匯總了PHP中Zend\EventManager\EventManagerInterface::attach方法的典型用法代碼示例。如果您正苦於以下問題:PHP EventManagerInterface::attach方法的具體用法?PHP EventManagerInterface::attach怎麽用?PHP EventManagerInterface::attach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\EventManager\EventManagerInterface的用法示例。


在下文中一共展示了EventManagerInterface::attach方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: attach

 /**
  * @see \Zend\EventManager\ListenerAggregateInterface::attach()
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach('preFind', [$this, 'preFind']);
     $this->listeners[] = $events->attach('postFind', [$this, 'postFind']);
     $this->listeners[] = $events->attach('onSave', [$this, 'onSave']);
     $this->listeners[] = $events->attach('onDelete', [$this, 'onDelete']);
 }
開發者ID:comphppuebla,項目名稱:restful-extensions,代碼行數:10,代碼來源:CacheListener.php

示例2: attach

 /**
  * Attach listeners to an event manager
  *
  * @param  EventManagerInterface $events
  * @return void
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'));
     if (function_exists('zend_monitor_custom_event_ex')) {
         $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'reportMonitorEvent'));
     }
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:13,代碼來源:DispatchListener.php

示例3: attach

 /**
  * Attach one or more listeners
  *
  * Implementors may add an optional $priority argument; the EventManager
  * implementation will pass this to the aggregate.
  *
  * @param EventManagerInterface $events
  *
  * @return void
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach('action.send.pre', [$this, 'onSendingAction']);
     $this->listeners[] = $events->attach('node.send.pre', [$this, 'onSendingNode']);
     $this->listeners[] = $events->attach('node.send.post', [$this, 'onNodeSent']);
     $this->listeners[] = $events->attach('node.received', [$this, 'onNodeReceived']);
 }
開發者ID:CarsonF,項目名稱:WhatsApi,代碼行數:17,代碼來源:InjectIdListener.php

示例4: attach

 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onPreDispatch'), 9999);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'onPreDispatch'), 9999);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_FINISH, array($this, 'onFinish'));
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onPreRoute'), 9999);
 }
開發者ID:zend-modules,項目名稱:localemanager_outdated,代碼行數:7,代碼來源:SendResponseListener.php

示例5: attach

 /**
  * @param EventManager\EventManagerInterface $events
  */
 public function attach(EventManager\EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_DELETE_PRE, array($this, 'delete'));
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_FETCH_POST, array($this, 'fetch'));
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_FETCH_ALL_PRE, array($this, 'fetchAll'));
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_PATCH_PRE, array($this, 'patch'));
 }
開發者ID:dotuancd,項目名稱:secretary,代碼行數:10,代碼來源:NoteEventListener.php

示例6: attach

 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_BOOTSTRAP, [$this, 'onBootstrap']);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute']);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch']);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'onDispatchError']);
 }
開發者ID:alex-oleshkevich,項目名稱:zf-extras,代碼行數:7,代碼來源:MvcEventListener.php

示例7: attach

 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(Event::RUN_JOB, array($this, 'jobHeader'), 1000);
     $this->listeners[] = $events->attach(Event::RUN_JOB, array($this, 'jobFooter'), -1000);
     $this->listeners[] = $events->attach(Event::RUN_TASK, array($this, 'taskHeader'), 1000);
     $this->listeners[] = $events->attach(Event::RUN_TASK, array($this, 'taskFooter'), -1000);
 }
開發者ID:sporkcode,項目名稱:sporktools,代碼行數:7,代碼來源:Notifications.php

示例8: attach

 public function attach(EventManagerInterface $events, $priority = 1)
 {
     if (PHP_SAPI !== 'cli') {
         $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute']);
         $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRender']);
     }
 }
開發者ID:alex-oleshkevich,項目名稱:zf-extras,代碼行數:7,代碼來源:AclListener.php

示例9: attach

 /**
  * Attach listeners
  *
  * @param EventManagerInterface $events
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'authentication'), -50);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'authenticationPost'), -51);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'authorization'), -600);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'authorizationPost'), -601);
 }
開發者ID:jbarentsen,項目名稱:drb,代碼行數:12,代碼來源:MvcRouteListener.php

示例10: attach

 /**
  * {@inheritDoc}
  */
 public function attach(EventManagerInterface $eventManager, $priority = 1)
 {
     $sharedManager = $eventManager->getSharedManager();
     $sharedManager->attach(DispatchableInterface::class, MvcEvent::EVENT_DISPATCH, [$this, 'setTemplate'], -100);
     $this->listeners[] = $eventManager->attach(ViewEvent::EVENT_RENDERER, [$this, 'selectRenderer'], $priority);
     $this->listeners[] = $eventManager->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);
 }
開發者ID:omusico,項目名稱:zfr-rest,代碼行數:10,代碼來源:ResourceStrategy.php

示例11: attach

 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach('bootstrap', array($this, 'onBootstrap'), 10000);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'beforeDispatch'), 100);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 0);
     //$this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, array($this, 'onRender'), 0);
 }
開發者ID:ahyswang,項目名稱:eva-engine,代碼行數:7,代碼來源:ViewManager.php

示例12: attach

 /**
  * @param EventManagerInterface $events
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_BOOTSTRAP, array($this, 'handleNativeErrors'), -1);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_BOOTSTRAP, array($this, 'handleFatalErrors'), -2);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'handleExceptions'), -1);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, array($this, 'handleExceptions'), -1);
 }
開發者ID:bikashpoudel,項目名稱:zf2errorhandler,代碼行數:10,代碼來源:ErrorHandler.php

示例13: attach

 public function attach(EventManagerInterface $events)
 {
     // Set priority greater than 1
     // so layout can be disabled in controller action if I want
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'updateLayout'], 100);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'keepLayout']);
 }
開發者ID:hoangpt,項目名稱:nextcms,代碼行數:7,代碼來源:LayoutListener.php

示例14: attach

 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach('postOrder', array($this, 'sendConfirmation'), 300);
     $this->listeners[] = $events->attach('postOrder', array($this, 'updateStock'), 100);
     $this->listeners[] = $events->attach('postOrder', array($this, 'bakePizza'), 200);
     $this->listeners[] = $events->attach('preOrder', array($this, 'checkStock'), 100);
 }
開發者ID:dulumao,項目名稱:big5,代碼行數:7,代碼來源:OrderListener.php

示例15: attach

 /**
  * {@inheritdoc}
  */
 public function attach(EventManagerInterface $events, $priority = 1)
 {
     $callback = array($this, 'hashKey');
     $this->listeners[] = $events->attach('hasItem.pre', $callback, $priority);
     $this->listeners[] = $events->attach('getItem.pre', $callback, $priority);
     $this->listeners[] = $events->attach('setItem.pre', $callback, $priority);
 }
開發者ID:butkimtinh,項目名稱:ZendSkeletonApplication,代碼行數:10,代碼來源:HashKey.php


注:本文中的Zend\EventManager\EventManagerInterface::attach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。