Beispiel #1
0
 public function display($tpl)
 {
     $view = Stourweb_View::factory($tpl);
     foreach ($this->_data as $key => $value) {
         $view->set($key, $value);
     }
     $this->response->body($view->render());
 }
Beispiel #2
0
 public function display($tpl)
 {
     $file = $GLOBALS['cfg_templet'] . '/' . $tpl;
     if (!file_exists(APPPATH . '/views/' . $GLOBALS['cfg_templet'] . '/' . $tpl . '.php')) {
         $file = 'mobile/' . $tpl;
     }
     //$tpl = !empty($GLOBALS['cfg_templet']) ? $GLOBALS['cfg_templet'].'/'.$tpl : $tpl;//是否定义默认模板判断.
     $view = Stourweb_View::factory($file);
     foreach ($this->_data as $key => $value) {
         $view->set($key, $value);
     }
     $this->response->body($view->render());
 }