From b52416c3a6879083b9bca1948ad6c247ee69ed7b Mon Sep 17 00:00:00 2001 From: oldrind <1401019000@qq.com> Date: Tue, 2 Feb 2016 13:24:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=89=BE=E4=B8=8D=E5=88=B0=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template/TagLib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/template/TagLib.php b/library/think/template/TagLib.php index 57c4090d..036f20c5 100644 --- a/library/think/template/TagLib.php +++ b/library/think/template/TagLib.php @@ -95,7 +95,7 @@ class TagLib // 别名设置 foreach (explode(',', $val['alias']) as $v) { $_key = $lib ? $lib . ':' . $v : $v; - $tags[$close][$_key] = $name; + $tags[$close][$_key] = $v; } } } @@ -136,7 +136,7 @@ class TagLib // 标签替换 从后向前 foreach ($nodes as $pos => $node) { // 对应的标签名 - $name = $node['name']; + $name = $tags[1][$node['name']]; // 解析标签属性 $attrs = $this->parseAttr($node['begin'][0], $name); $method = '_' . $name; @@ -173,7 +173,7 @@ class TagLib $regex = $this->getRegex(array_keys($tags[0]), 0); $content = preg_replace_callback($regex, function ($matches) use (&$tags) { // 对应的标签名 - $name = $matches[1]; + $name = $tags[0][$matches[1]]; // 解析标签属性 $attrs = $this->parseAttr($matches[0], $name); $method = '_' . $name;