Beispiel #1
0
 /**
  * This action is executed before execute any action in the application
  *
  * @param Event               $event
  * @param Dispatcher          $dispatcher
  * @param DispatcherException $exception
  */
 public function beforeException(Event $event, MvcDispatcher $dispatcher, $exception)
 {
     $object = $event->getData();
     $this->view->setVar('message', $object->getMessage());
     switch ($exception->getCode()) {
         case Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
         case Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
             $dispatcher->forward(array('controller' => 'error', 'action' => 'show404'));
             return false;
         case Dispatcher::EXCEPTION_CYCLIC_ROUTING:
             $dispatcher->forward(['controller' => 'errors', 'action' => 'reports']);
             return false;
     }
 }
 public function __construct($regex, $message)
 {
     parent::__construct('regular expression is malformed: "' . $regex . '"<br />' . $message);
 }
 public function __construct($url)
 {
     parent::__construct('No pattern matching this url "' . $url . '" in the dispatcher\'s list');
 }
 public function __construct($controller)
 {
     parent::__construct('Class "' . $controller . '" is not a valid controller (does not implement Controller)');
 }
 /**
  *
  * @param int $code See the constants defined in this class
  * @param string $message
  */
 public function __construct($code, $message = null, $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }