From b9d4c41eface0f7f320dbdbfc8ae2b0402ec5465 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 20 Feb 2016 12:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E5=9B=BE=E9=85=8D=E7=BD=AE=E6=96=B9?= =?UTF-8?q?=E6=B3=95config=E6=94=AF=E6=8C=81=E8=8E=B7=E5=8F=96=E6=9F=90?= =?UTF-8?q?=E4=B8=AA=E9=85=8D=E7=BD=AE=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/View.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/View.php b/library/think/View.php index 8731c38d..03c7e7e8 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -81,7 +81,7 @@ class View * @param string $value 值 * @return View */ - public function config($config = '', $value = '') + public function config($config = '', $value = null) { if (is_array($config)) { foreach ($this->config as $key => $val) { @@ -89,6 +89,9 @@ class View $this->config[$key] = $config[$key]; } } + } elseif (is_null($value)) { + // 获取配置参数 + return $this->config[$config]; } else { $this->config[$config] = $value; }