From 1ea21cfc64c44866b24dc1b0e3b09104e71e07a3 Mon Sep 17 00:00:00 2001 From: shirne Date: Sat, 24 Apr 2021 11:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Binclude=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=E8=A7=A3=E6=9E=90=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E5=8F=98=E9=87=8F=E4=BC=A0=E9=80=92?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E4=B8=8D=E6=98=AF=E7=9B=B4=E6=8E=A5=E4=BC=A0?= =?UTF-8?q?=E9=80=92=E5=8F=98=E9=87=8F=E7=9A=84=E5=80=BC=EF=BC=8C=E5=8F=A6?= =?UTF-8?q?=E5=A4=96=E5=A2=9E=E5=8A=A0=E5=87=BD=E6=95=B0=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E4=BC=A0=E9=80=92(=20=E5=A6=82=20lang('xxx')=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);