模板引擎类的display和fetch方法改进

This commit is contained in:
thinkphp
2013-03-29 11:52:19 +08:00
parent 8ac5b41c42
commit 9d0f671d2a
2 changed files with 14 additions and 20 deletions

View File

@@ -13,16 +13,12 @@ namespace Think\View\Driver;
use Think\Template;
class Think {
private $template = null;
public function __construct($config=array()){
$tpl = new Template($config);
$this->template = $tpl;
//$tpl->tpl_path = MODULE_PATH.'view/';
//$tpl->cache_path = MODULE_PATH.'cache/';
public function __construct($config=[]){
$this->template = new Template($config);
}
public function fetch($template,$data=array()){
$this->template->assign($data);
$this->template->display($template);
public function fetch($template,$data=[]){
$this->template->display($template,$data);
}
}