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


PHP Manager::collectResponses方法代码示例

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


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

示例1: setEventsManager

 /**
  * Override events manager default in Phalcon
  * @return \Phalex\Di\Di
  */
 protected function setEventsManager()
 {
     $ev = new EventsManager();
     $ev->enablePriorities(true);
     $ev->collectResponses(true);
     $this->set('eventsManager', $ev, true);
     return $this;
 }
开发者ID:tmquang6805,项目名称:phalex,代码行数:12,代码来源:Di.php

示例2: __construct

 /**
  *
  * @param Di $diFactory
  */
 public function __construct(Di $diFactory)
 {
     $this->diFactory = $diFactory;
     $this->loader = new Loader();
     $ev = new EventsManager();
     $ev->enablePriorities(true);
     $ev->collectResponses(true);
     $diFactory->set('autoloaderEventsManager', $ev, true);
     $this->loader->setEventsManager($ev);
 }
开发者ID:tmquang6805,项目名称:phalex,代码行数:14,代码来源:Autoloader.php

示例3: __construct

 public function __construct(Di $di)
 {
     parent::__construct();
     $this->di = $di;
     $eventsManager = new EventsManager();
     $eventsManager->enablePriorities(true);
     $eventsManager->collectResponses(true);
     $di->set('eventsManager', $eventsManager, true);
     $this->setEventsManager($eventsManager);
     $this->setDI($di);
     $this->setDefaultAction('index');
     $this->setDefaultController('index');
 }
开发者ID:tmquang6805,项目名称:phalex,代码行数:13,代码来源:Dispatcher.php

示例4: EventsManager

<?php

use Phalcon\Events\Manager as EventsManager;
$evManager = new EventsManager();
//Set up the events manager to collect responses
$evManager->collectResponses(true);
//Attach a listener
$evManager->attach('custom:custom', function () {
    return 'first response';
});
//Attach a listener
$evManager->attach('custom:custom', function () {
    return 'second response';
});
//Fire the event
$evManager->fire('custom:custom', null);
//Get all the collected responses
print_r($evManager->getResponses());
开发者ID:aodkrisda,项目名称:phalcon-code,代码行数:18,代码来源:events-345.php


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