/** * 加载公共组件文件 * @param string $tpl 模板名称 * @param array $tpl_vars 视图数据 * @return Template $this 返回当前对象进行连贯操作 */ public function component($tpl, array $tpl_vars = array()) { $this->setScriptPath(sprintf('%scomponent', COMMON_VIEW_PATH)); parent::display("{$tpl}.phtml", $tpl_vars); return $this; }
/** * @brief display XSS encode * @param type $tpl * @param type $var_array */ public function display($tpl, $var_array = array()) { $this->_xssSafe($var_array); parent::display($tpl, $var_array); }
/** * Display page * @param string $view_path filepath, ex: production/index.html. * @param array $tpl_vars display variables. * @return string */ public function display($view_path, $tpl_vars = null) { header("Content-type: text/html; charset=utf-8"); parent::display($view_path, $tpl_vars); }
/** * Display page * @param string $view_path filepath, ex: production/index.html. * @param array $tpl_vars display variables. * @return string */ public function display($view_path = '', $tpl_vars = null) { header('Content-type: application/json'); parent::display('response.html'); }