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


PHP sfEventDispatcher::notifyUntil方法代码示例

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


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

示例1: sfEvent

$dispatcher->notify(new sfEvent(new stdClass(), 'foo'));
$t->is($listener->getValue(), 'listenToFooBislistenToFoo', '->notify() notifies all registered listeners in order');
// ->notifyUntil()
$t->diag('->notifyUntil()');
$listener->reset();
$dispatcher = new sfEventDispatcher();
$dispatcher->connect('foo', array($listener, 'listenToFoo'));
$dispatcher->connect('foo', array($listener, 'listenToFooBis'));
$e = $dispatcher->notifyUntil($event = new sfEvent(new stdClass(), 'foo'));
$t->is($listener->getValue(), 'listenToFoolistenToFooBis', '->notifyUntil() notifies all registered listeners in order and stops if it returns true');
$t->is($e, $event, '->notifyUntil() returns the event object');
$listener->reset();
$dispatcher = new sfEventDispatcher();
$dispatcher->connect('foo', array($listener, 'listenToFooBis'));
$dispatcher->connect('foo', array($listener, 'listenToFoo'));
$e = $dispatcher->notifyUntil($event = new sfEvent(new stdClass(), 'foo'));
$t->is($listener->getValue(), 'listenToFooBis', '->notifyUntil() notifies all registered listeners in order and stops if it returns true');
// ->filter()
$t->diag('->filter()');
$listener->reset();
$dispatcher = new sfEventDispatcher();
$dispatcher->connect('foo', array($listener, 'filterFoo'));
$dispatcher->connect('foo', array($listener, 'filterFooBis'));
$e = $dispatcher->filter($event = new sfEvent(new stdClass(), 'foo'), 'foo');
$t->is($e->getReturnValue(), '-*foo*-', '->filter() filters a value');
$t->is($e, $event, '->filter() returns the event object');
$listener->reset();
$dispatcher = new sfEventDispatcher();
$dispatcher->connect('foo', array($listener, 'filterFooBis'));
$dispatcher->connect('foo', array($listener, 'filterFoo'));
$e = $dispatcher->filter($event = new sfEvent(new stdClass(), 'foo'), 'foo');
开发者ID:Phennim,项目名称:symfony1,代码行数:31,代码来源:sfEventDispatcherTest.php

示例2: notifyUntil

 public function notifyUntil(sfEvent $event)
 {
     $this->_events[] = $event;
     return parent::notifyUntil($event);
 }
开发者ID:sympal,项目名称:sympal,代码行数:5,代码来源:sfSympalEventListTask.class.php


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