Example #1
0
 public function run()
 {
     $controller_path = CONTROLLER . $this->_controller . "Controller.php";
     if (!file_exists($controller_path)) {
         if (empty($_SESSION['userData'])) {
             $redir = new RedirectorHelper();
             $redir->goToController("");
         } else {
             $this->setMsg("notice", "<strong>Atenção!</strong> Controller inexistente!");
             $redir = new RedirectorHelper();
             $redir->goToControllerAction("index", "blank");
             die('Houve um erro, Controller inexistente!');
         }
     }
     require_once $controller_path;
     $app = new $this->_controller();
     if (!method_exists($app, $this->_action)) {
         //die('Houve um erro, Action inexistente!');
         $this->setMsg("erro", "Model / Helper / Action inexistente!");
         $redir = new RedirectorHelper();
         $redir->goToController("");
     }
     $action = $this->_action;
     $app->init();
     $app->{$action}();
 }
Example #2
0
 public function logout()
 {
     session_destroy();
     $redirector = new RedirectorHelper();
     $redirector->goToController("");
 }