public function display($tpl) { $view = Stourweb_View::factory($tpl); foreach ($this->_data as $key => $value) { $view->set($key, $value); } $this->response->body($view->render()); }
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()); }