Exemple #1
0
 /**
  * [display 显示模板]
  * @param  [string] $tpl [模板文件]
  * @return null
  */
 protected function display($tpl = NULL)
 {
     $path = $this->get_tpl($tpl);
     is_file($path) or halt($path . '模板不存在');
     if (C('SMARTY_ON')) {
         return parent::display($path);
     } else {
         extract($this->vars);
         include $path;
         return;
     }
 }
 protected function display($tpl = null)
 {
     $path = $this->get_tpl($tpl);
     if (!is_file($path)) {
         halt($path . "模板文件不存在");
     }
     if (C("SMARTY_ON")) {
         parent::display($path);
     } else {
         extract($this->var);
         include $path;
     }
 }
Exemple #3
0
 function buildView($template, $userData, $output = false)
 {
     require_once dirname(__FILE__) . '/smartyview.php';
     $view = new SmartyView();
     $view->init($this->app);
     $view->setArray($userData);
     if (!$output) {
         $result = $view->build($template);
     } else {
         $result = $view->display($template);
     }
     return $result;
 }
Exemple #4
0
 /**
  * [display 展示模板方法]
  * @param  [type] $tpl [description]
  * @return [type]      [description]
  */
 protected function display($tpl = NULL)
 {
     $path = $this->get_tpl($tpl);
     if (!is_file($path)) {
         halt($path . '模板文件不存在');
     }
     if (C('SMARTY_ON')) {
         parent::display($path);
     } else {
         extract($this->var);
         include $path;
     }
 }