From 588875a1be0bfdf9eae05c32e9797da958f4bc84 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 14 Mar 2016 09:39:31 +0800 Subject: [PATCH] =?UTF-8?q?View=E7=B1=BBengine=E5=8F=82=E6=95=B0=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E4=B8=BAview=5Fengine=20=E9=81=BF=E5=85=8D=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/View.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/library/think/View.php b/library/think/View.php index 277b6d7b..25ce9612 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -44,7 +44,7 @@ class View // 视图驱动命名空间 'namespace' => '\\think\\view\\driver\\', // 模板引擎配置参数 - 'engine' => [ + 'view_engine' => [ 'type' => 'think', ], ]; @@ -55,12 +55,7 @@ class View if (empty($this->config['view_path']) && defined('VIEW_PATH')) { $this->config['view_path'] = VIEW_PATH; } - $this->config['engine'] = array_merge($this->config['engine'], [ - 'view_path' => $this->config['view_path'], - 'view_suffix' => $this->config['view_suffix'], - 'view_depr' => $this->config['view_depr'], - ]); - $this->engine($this->config['engine']['type'], $this->config['engine']); + $this->engine($this->config['view_engine']['type'], $this->config['view_engine']); } /** @@ -131,7 +126,12 @@ class View if ('php' == $engine) { $this->engine = 'php'; } else { - $class = $this->config['namespace'] . ucwords($engine); + $class = $this->config['namespace'] . ucwords($engine); + $config = array_merge($config, [ + 'view_path' => $this->config['view_path'], + 'view_suffix' => $this->config['view_suffix'], + 'view_depr' => $this->config['view_depr'], + ]); $this->engine = new $class($config); } return $this;