优化视图,支持连操作,如:

return View::getInstance(Config::get())->assign($vars)->fetch();
This commit is contained in:
huangdijia
2015-12-22 14:16:50 +08:00
parent 92be99e35f
commit 429af2f86b

View File

@@ -40,6 +40,14 @@ class View
$this->config($config);
$this->engine($this->config['engine_type']);
}
/**
* 初始化视图
* @access public
* @param array $config 配置参数
*/
static public function getInstance(array $config = []){
return self($config);
}
/**
* 模板变量赋值
@@ -55,6 +63,7 @@ class View
} else {
$this->data[$name] = $value;
}
return $this;
}
/**