code: public function handle( IEvent $event, $name, IDispatcher $dispatcher )
      {
          if ( $event instanceof BeforeControllerRunEvent )
          {
              return $this->onBeforeAction();
          }
          elseif ( $event instanceof AfterControllerRunEvent )
          {
              return $this->onAfterAction();
          }
      }
docs: Handle an event.
  
  @param IEvent      $event
  @param string      $name
  @param IDispatcher $dispatcher