Example #1
0
 public function callController()
 {
     if (Configuration::isSiteOffline()) {
         new Core_Template("clean", "error", "siteMaintenance");
         return;
     }
     // Check first if the controller exists in the controllers
     if (!class_exists($this->controller)) {
         $template = new Core_Template("default", "error", "pageNotFound");
         $template->setAttribute("page", $this->module);
         return;
     }
     // Checks if the method doesnt exists in the controller
     if (!method_exists($this->controller, $this->method)) {
         $template = new Core_Template("default", "error", "pageNotFound");
         $template->setAttribute("page", $this->method);
         return;
     }
     $dispatch = new $this->controller();
     if ((int) method_exists($this->controller, $this->method)) {
         call_user_func_array(array($dispatch, $this->method), $this->queryString);
     }
 }