From 612a9cbae929e01bf932755c7bd9571658508d1f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 25 Apr 2016 10:38:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BView=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/View.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/think/View.php b/library/think/View.php index 9494ecd8..1afeff76 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -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);