mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
修正自定义标签找不到方法名的问题
This commit is contained in:
@@ -95,7 +95,7 @@ class TagLib
|
|||||||
// 别名设置
|
// 别名设置
|
||||||
foreach (explode(',', $val['alias']) as $v) {
|
foreach (explode(',', $val['alias']) as $v) {
|
||||||
$_key = $lib ? $lib . ':' . $v : $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) {
|
foreach ($nodes as $pos => $node) {
|
||||||
// 对应的标签名
|
// 对应的标签名
|
||||||
$name = $node['name'];
|
$name = $tags[1][$node['name']];
|
||||||
// 解析标签属性
|
// 解析标签属性
|
||||||
$attrs = $this->parseAttr($node['begin'][0], $name);
|
$attrs = $this->parseAttr($node['begin'][0], $name);
|
||||||
$method = '_' . $name;
|
$method = '_' . $name;
|
||||||
@@ -173,7 +173,7 @@ class TagLib
|
|||||||
$regex = $this->getRegex(array_keys($tags[0]), 0);
|
$regex = $this->getRegex(array_keys($tags[0]), 0);
|
||||||
$content = preg_replace_callback($regex, function ($matches) use (&$tags) {
|
$content = preg_replace_callback($regex, function ($matches) use (&$tags) {
|
||||||
// 对应的标签名
|
// 对应的标签名
|
||||||
$name = $matches[1];
|
$name = $tags[0][$matches[1]];
|
||||||
// 解析标签属性
|
// 解析标签属性
|
||||||
$attrs = $this->parseAttr($matches[0], $name);
|
$attrs = $this->parseAttr($matches[0], $name);
|
||||||
$method = '_' . $name;
|
$method = '_' . $name;
|
||||||
|
|||||||
Reference in New Issue
Block a user