From 29d3d9e5038a3b85a7162af9a3b9dc8e61ac5534 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 26 Apr 2016 17:09:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/View.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/think/View.php b/library/think/View.php index 2ff2be44..aa89b0bf 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -19,20 +19,20 @@ class View public $engine = null; // 模板变量 protected $data = []; - // 视图替换 + // 视图输出替换 protected $replace = []; /** * 架构函数 * @access public * @param array $engine 模板引擎参数 + * @param array $replace 字符串替换参数 */ - public function __construct($engine = []) + public function __construct($engine = [], $replace = []) { // 初始化模板引擎 - if (!empty($engine)) { - $this->engine($engine); - } + $this->engine((array) $engine); + $this->replace = $replace; } /** @@ -73,7 +73,7 @@ class View * @param array $options 引擎参数 * @return $this */ - public function engine(array $options = []) + public function engine($options = []) { $type = !empty($options['type']) ? $options['type'] : 'Think'; $class = (!empty($options['namespace']) ? $options['namespace'] : '\\think\\view\\driver\\') . ucfirst($type);