From 177023fa0e21ff34268065ab27fcacac9cfbf27c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 28 Jun 2016 22:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=A8=A1=E6=9D=BF=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=20$Request.=20=E6=94=AF=E6=8C=81$Request.root.true=20?= =?UTF-8?q?=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Template.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/library/think/Template.php b/library/think/Template.php index 56a27453..97c01d4e 100644 --- a/library/think/Template.php +++ b/library/think/Template.php @@ -856,8 +856,15 @@ class Template $parseStr = $this->parseThinkVar($vars); } elseif ('$Request' == $first) { // 获取Request请求对象参数 - $method = array_shift($vars); - $params = !empty($vars) ? '\'' . implode('.', $vars) . '\'' : ''; + $method = array_shift($vars); + if (!empty($vars)) { + $params = implode('.', $vars); + if ('true' != $params) { + $params = '\'' . $params . '\''; + } + } else { + $params = ''; + } $parseStr = '\think\Request::instance()->' . $method . '(' . $params . ')'; } else { switch ($this->config['tpl_var_identify']) {