示例#1
0
 function _before(&$Controller)
 {
     empty($Controller->model) ? $Controller->model = $Controller->params['controller'] : null;
     empty($Controller->models) ? $Controller->models = array() : null;
     empty($Controller->_assigns) ? $Controller->_assigns = array() : null;
     empty($Controller->cookies) && isset($_COOKIE) ? $Controller->cookies =& $_COOKIE : null;
     if (empty($Controller->Response)) {
         require_once AK_LIB_DIR . DS . 'AkResponse.php';
         $Controller->Response =& AkResponse();
     }
     if (empty($Controller->Template)) {
         require_once AK_LIB_DIR . DS . 'AkActionView.php';
         require_once AK_LIB_DIR . DS . 'AkActionView' . DS . 'AkPhpTemplateHandler.php';
         $Controller->Template =& new AkActionView(AK_APP_DIR . DS . 'views' . DS . $Controller->Request->getController(), $Controller->Request->getParameters(), $Controller->Request->getController());
         $Controller->Template->_controllerInstance =& $Controller;
         $Controller->Template->_registerTemplateHandler('tpl', 'AkPhpTemplateHandler');
     }
     $Controller->passed_args = !isset($Controller->Request->pass) ? array() : $Controller->Request->pass;
     Ak::loadPlugins();
     $Controller->instantiateIncludedModelClasses();
     if (isset($Controller->api)) {
         require_once AK_LIB_DIR . DS . 'AkActionWebService.php';
         $Controller->aroundFilter(new AkActionWebService($Controller));
     }
 }
示例#2
0
 function dispatch()
 {
     $this->Request =& AkRequest();
     $this->Response =& AkResponse();
     $this->Controller =& $this->Request->recognize();
     $this->Controller->process($this->Request, $this->Response);
 }
示例#3
0
 function dispatch()
 {
     AK_ENABLE_PROFILER &&  Ak::profile(__CLASS__.'::'.__FUNCTION__.'() call');
     $this->Request =& AkRequest();
     $this->Response =& AkResponse();
     $this->Controller =& $this->Request->recognize();
     AK_ENABLE_PROFILER &&  Ak::profile('Request::recognize() completed');
     $this->Controller->process($this->Request, $this->Response);
 }