Ejemplo n.º 1
0
 /**
  * Start initialize controller
  * 
  * @param string
  * @param array
  * @return void
  */
 public function __init($method, $params)
 {
     $this->SKY = (object) ['method' => $method, 'params' => $params];
     // is class have method ?
     if (!method_exists($this, $method)) {
         Loader::getClass('Sky.core.Log')->write(300, $method . ' Page Not Found');
         Exceptions::show404();
     }
     // run before controller if have?
     if (method_exists($this, '__before')) {
         $this->__before();
     }
     call_user_func_array([$this, $method], $params);
     // run after controller if have?
     if (method_exists($this, '__after')) {
         $this->__after();
     }
 }