/** * @return TemplatePathsController */ function createControllerFor($action_name, $mime_type = 'html') { $controller_class_name = AkInflector::camelize($this->controller_name) . 'Controller'; $controller = new $controller_class_name(); $Request = $this->createGetRequest($action_name, $mime_type); $Response = $this->getMock('AkResponse', array('outputResults')); $controller->setRequestAndResponse($Request, $Response); $this->Template = $controller->Template = $this->getMock('AkActionView', array('renderFile'), array(AK_VIEWS_DIR . DS . $this->controller_name)); $this->Template->_registerTemplateHandler('tpl', 'AkPhpTemplateHandler'); $this->Template->_registerTemplateHandler('html.tpl', 'AkPhpTemplateHandler'); $this->action_name = $action_name; return $this->Controller = $controller; }
public function &_initializeTemplateClass($assigns) { require_once AK_LIB_DIR . DS . 'AkActionView.php'; $TemplateInstance = new AkActionView($this->getTemplatePath(), $assigns, $this); require_once AK_LIB_DIR . DS . 'AkActionView' . DS . 'AkPhpTemplateHandler.php'; $TemplateInstance->_registerTemplateHandler('tpl', 'AkPhpTemplateHandler'); return $TemplateInstance; }