From 9060a4dd8c7c5c6c776e2e1f4a9ba8f5b01e8002 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 27 Dec 2015 15:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3template=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/template.php b/library/think/template.php index faf130d4..06da38e4 100644 --- a/library/think/template.php +++ b/library/think/template.php @@ -591,9 +591,9 @@ class Template $flag = substr($str, 0, 1); switch ($flag) { case '$': // 解析模板变量 格式 {$varName} - $this->parseVar($str); // 是否带有?号 if (false !== $pos = strpos($str, '?')) { + $this->parseVar($str); $array = preg_split('/([!=]={1,2}|(?<]={0,1})/', substr($str, 0, $pos), 2, PREG_SPLIT_DELIM_CAPTURE); $name = trim($array[0]); $this->parseVarFunction($name); @@ -636,6 +636,7 @@ class Template } } } else { + $this->parseVar($str); $this->parseVarFunction($str); $str = ''; }