예제 #1
0
 private function loadRegistry()
 {
     \Registry::set('config', \NdkSolution\Config::getInstance());
     \Registry::set('session', \Session\Session::getInstance());
     \Registry::set('security', \Security\Security::getInstance());
 }
예제 #2
0
 private function loadMethod()
 {
     $method = array_shift($this->_segments);
     if (!$method) {
         $method = Config::get('default_method');
     }
     $m_tmp = $method . '_' . strtolower(Request::getRequestMethod());
     if (method_exists($this->_controller, $m_tmp)) {
         $method = $m_tmp;
     }
     if (method_exists($this->_controller, $method)) {
         call_user_func_array(array($this->_controller, $method), $this->_segments);
     } else {
         throw_error('Method `' . $method . '` is not found !');
     }
 }