/** * Must return a View object or something compatible * * @return Object any object on which the template vars can be set and which has a toString method */ protected function set_view() { if (is_string($this->_view)) { $this->_view = \View::forge($this->_view); } }
/** * Load partial view * * @access public * @param string $filename * @param array $data * @return string */ public function partial($filename, $data = null) { $this->load_assets(); $view = View::forge(); $view->set_path($this->folder); $view->set_filename($filename); $view->auto_filter(static::$config['auto_filter']); if (is_array($data) and count($data) > 0) { $view->set($data); } $view->set('TEMPLATE_FOLDER', $this->folder, false); $view->set('template', $this, false); return $view; }
/** * Prepare template * * @access protected */ protected function _prepare_template() { $theme_path = \Config::get('app.frontend.template'); if (null === $theme_path) { $theme_path = DOCROOT . 'themes/default/'; \Config::set('app.frontend.template', $theme_path); } \Hybrid\View::set_path($theme_path); \Asset::add_path($theme_path . 'assets/'); if (true === $this->auto_render) { $this->template = \Hybrid\View::factory(); $this->template->auto_encode(false); $this->template->set_filename('index'); } }