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


PHP EventManager::getEvents方法代码示例

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


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

示例1: getListeners

 /**
  * {@inheritDoc}
  */
 public function getListeners($eventName = null)
 {
     if (is_null($eventName)) {
         $listeners = array();
         foreach ($this->eventManager->getEvents() as $eventName) {
             $listeners[$eventName] = $this->getListeners($eventName);
         }
         return $listeners;
     }
     return $this->eventManager->getListeners($eventName)->toArray();
 }
开发者ID:malocher,项目名称:zf2-event-store-module,代码行数:14,代码来源:EventManagerProxy.php

示例2: index05Action

 public function index05Action()
 {
     $eventManagerOne = new \Zend\EventManager\EventManager();
     $eventManagerTwo = new \Zend\EventManager\EventManager();
     $eventManagerOne->attach("eventOne", function () {
         echo "<h3 style='color:red;font-weight:bold'>eventManagerOne - eventOne - Do 1</h3>";
     });
     $eventManagerOne->attach("eventOne", function () {
         echo "<h3 style='color:red;font-weight:bold'>eventManagerOne - eventOne - Do 2</h3>";
     });
     $eventManagerOne->attach("eventTwo", function () {
         echo "<h3 style='color:red;font-weight:bold'>eventManagerOne - eventTwo - Do 2</h3>";
     });
     $eventManagerTwo->attach("eventOne", function () {
         echo "<h3 style='color:red;font-weight:bold'>eventManagerTwo - evenOne - Do 1</h3>";
     });
     $eventManagerTwo->attach("eventOne", function () {
         echo "<h3 style='color:red;font-weight:bold'>eventManagerTwo - evenOne - Do 2</h3>";
     });
     // echo "<pre style='font-weight:bold'>";
     // print_r($eventManagerOne->getEvents());
     // echo "</pre>";
     $eventManagerTwo->trigger("eventOne");
     $listEventOne = $eventManagerOne->getEvents();
     echo "<pre style='font-weight:bold'>";
     print_r($listEventOne);
     echo "</pre>";
     return false;
 }
开发者ID:trongle,项目名称:zend-2,代码行数:29,代码来源:EventController.php

示例3: getEventsFromEventManager

 /**
  * Retrieve a list of event names from an event manager.
  *
  * @param EventManager $events
  * @return string[]
  */
 private function getEventsFromEventManager(EventManager $events)
 {
     return $events->getEvents();
 }
开发者ID:kienbk1910,项目名称:RDCAdmin,代码行数:10,代码来源:EventListenerIntrospectionTrait.php


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