Exemplo n.º 1
0
 /**
  * @throws Exceptions\InvalidRouteException
  */
 private function executeError()
 {
     header("HTTP/1.0 404 Not Found");
     if ($this->configuration->getRoute("404")) {
         $action = $this->getAction($this->configuration->getRoute("404"));
         if (!App::loadController($action->controller_class)) {
             throw new Exceptions\InvalidRouteException("Error - Invalid route definition | " . __METHOD__, 1010);
         }
         Router::redirect($this->configuration->getRoute("404"));
     }
     throw new Exceptions\InvalidRouteException("Error 404 - Not found");
 }
Exemplo n.º 2
0
 /**
  * Carrega as controllers
  * @param string $controller nome da controller
  */
 public function loadController($controller)
 {
     if (App::loadController($controller)) {
         $this->{$controller} = new $controller();
     }
 }