Example #1
0
 /**
  * Routs the request to the controller
  */
 public function route()
 {
     $this->getParameters();
     $this->classloader->loadController($this->controller);
     $controllerClass = Controller::getName($this->controller);
     $controller = new $controllerClass();
     //BeforeAction Hook execution
     if (isset($this->beforeActionHook)) {
         foreach ($this->beforeActionHook as $hook) {
             $hook->beforeAction($controller);
         }
     }
     $controller->{$this->action}();
     //AfterAction Hook execution
     if (isset($this->afterActionHook)) {
         foreach ($this->afterActionHook as $hook) {
             $hook->afterAction($controller);
         }
     }
     $controller->render();
 }
Example #2
0
 public function getBaseUrl()
 {
     return DIAMONDMVC_URL . "/views/" . $this->controller->getName() . "/templates";
 }