Example #1
0
 /**
  * start app
  * @throws \Exception
  */
 public function start()
 {
     // load class
     if (!$this->load($this->app_path . $this->controllers_dir . DIRECTORY_SEPARATOR . ($controller_name = $this->request->get_controller()))) {
         throw new \Exception('File not found!', 404);
     }
     $c = new $controller_name();
     if (!method_exists($c, $this->request->get_action())) {
         throw new \Exception('Page not found!', 404);
     }
     call_user_method($this->request->get_action(), $c);
 }
 public function __construct()
 {
     $this->_request = \SimpleMVC\Request::instance();
     $this->_app = \SimpleMVC\App::instance();
     $this->_config = new \SimpleMVC\Config();
 }