/** * 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; }
/** * 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); } }