private static final function loadController() { $view = \View\ViewBundle::getInstance(); //$view -> setTemplate( KIT_VIEW_TEMPLATE ); ////\View\ViewBundle::getInstance() -> setVar( 'path', self::$_path ); self::prepareController(); $space = 'App\\Controllers\\' . self::$_controller . 'Controller'; $e404 = ['controller' => self::$_controller, 'action' => self::$_action]; if (!\Autoload::nameSpaceExists($space)) { return $view->e404($e404); } $cont = new $space(); $cont->setTpl(self::$_controller . '/' . self::$_action); $act_method = "action" . self::$_action; /** * Проверка существования метода экшена и выполнение его, или стандартного * метода 404 ошибки. */ if (method_exists($cont, $act_method)) { $cont->{$act_method}(self::$_furl); $cont->exir(); } else { $view->e404($e404); } }
/** * Возврат пути бокс файла с частью блока или формы * @param string $boxname * @return string */ protected function getBoxPath($boxname) { $template = \View\ViewBundle::getTemplate(); if (file_exists(KIT_APP . "/Views/Box/{$template}/{$boxname}.php")) { $box_path = KIT_APP . "/Views/Box/{$template}/{$boxname}.php"; } else { if (file_exists(KIT_APP . "/Views/Box/{$template}/Notfound.php")) { $box_path = KIT_APP . "/Views/Box/{$template}/Notfound.php"; } else { $box_path = KIT_CORE . '/Etc/SystemTpl/BoxNotFound.php'; } } return $box_path; }
protected static function setBlock($block, $type, $info) { \View\ViewBundle::getInstance()->getObj('renderinfo')->setBlock($block, $type, $info); }
/** * @param \Group\Form $form */ public function __construct(\Group\Form $form) { $this->_form = $form; $this->_template = \View\ViewBundle::getTemplate(); }
protected function setVar($name, $data, $decode = true) { $view = \View\ViewBundle::getInstance()->setVar($name, $data, $decode); }