Example #1
0
 /**
  * @param Event $event
  */
 protected function dispatchEvent(Event $event)
 {
     $type = $event->getType();
     if ($this->hasListenersForType($type)) {
         foreach ($this->eventListeners[$type] as $listener) {
             call_user_func($listener, $event);
             if ($event->cancelled()) {
                 break;
             }
         }
     }
 }
Example #2
0
 /**
  * @param Event $e
  */
 public function onFormValid(Event $e)
 {
     echo $e->getType() . '<br/>';
 }