Exemple #1
0
 /**
  * 加载公共组件文件
  * @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;
 }
Exemple #2
0
 /**
  * @brief render XSS encode
  * @param type $tpl
  * @param type $var_array
  */
 public function render($tpl, $var_array = array())
 {
     $this->_xssSafe($var_array);
     parent::render($tpl, $var_array);
 }
Exemple #3
0
 /**
  * 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);
 }
Exemple #4
0
 /**
  * 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');
 }