mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进View类
This commit is contained in:
@@ -35,6 +35,11 @@ class View
|
||||
if (is_array($config)) {
|
||||
$this->config($config);
|
||||
}
|
||||
|
||||
// 初始化模板引擎
|
||||
if (!empty($this->config['engine_type'])) {
|
||||
$this->engine($this->config['engine_type'], $this->config['engine_config']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,10 +125,7 @@ class View
|
||||
{
|
||||
// 模板变量
|
||||
$vars = array_merge($this->data, $vars);
|
||||
if (is_null($this->engine)) {
|
||||
// 初始化模板引擎
|
||||
$this->engine($this->config['engine_type'], $this->config['engine_config']);
|
||||
}
|
||||
|
||||
// 页面缓存
|
||||
ob_start();
|
||||
ob_implicit_flush(0);
|
||||
|
||||
Reference in New Issue
Block a user