本文整理汇总了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;
}
示例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);
}
示例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');
}
示例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());