diff --git a/src/Template.php b/src/Template.php index 0feca8e..fa1d949 100644 --- a/src/Template.php +++ b/src/Template.php @@ -571,8 +571,8 @@ private function parseInclude(string &$content): void foreach ($array as $k => $v) { // 以$开头字符串转换成模板变量 - if (0 === strpos($v, '$')) { - $v = $this->get(substr($v, 1)); + if (0 === strpos($v, '$') || 0 === strpos($v, ':')) { + $v = '{' . $v . '}'; } $parseStr = str_replace('[' . $k . ']', $v, $parseStr);