From 66f433330d1113b88b8bfe5b3a55879cc93527e1 Mon Sep 17 00:00:00 2001 From: Haotong Lin Date: Thu, 17 Dec 2015 13:28:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dswitch...case=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=A0=87=E7=AD=BE=E5=B5=8C=E5=A5=97=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=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 | 6 +++--- library/think/template/taglib/cx.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/template.php b/library/think/template.php index 0b9404c2..39770b1f 100644 --- a/library/think/template.php +++ b/library/think/template.php @@ -495,7 +495,7 @@ class Template foreach ($tLib->getTags() as $name => $val) { $tags = [$name]; if (isset($val['alias'])) { -// 别名设置 + // 别名设置 $tags = explode(',', $val['alias']); $tags[] = $name; } @@ -659,10 +659,10 @@ class Template //模板函数过滤 $fun = strtolower(trim($args[0])); switch ($fun) { - case 'default': // 特殊模板函数 + case 'default': // 特殊模板函数 $name = '(' . $name . ')?(' . $name . '):' . $args[1]; break; - default: // 通用模板函数 + default: // 通用模板函数 if (!in_array($fun, $template_deny_funs)) { if (isset($args[1])) { if (strstr($args[1], '###')) { diff --git a/library/think/template/taglib/cx.php b/library/think/template/taglib/cx.php index 07d5558a..5d97f77d 100644 --- a/library/think/template/taglib/cx.php +++ b/library/think/template/taglib/cx.php @@ -33,7 +33,7 @@ class Cx extends Taglib 'elseif' => ['attr' => 'condition', 'close' => 0], 'else' => ['attr' => '', 'close' => 0], 'switch' => ['attr' => 'name', 'level' => 2], - 'case' => ['attr' => 'value,break'], + 'case' => ['attr' => 'value,break', 'level' => 2], 'default' => ['attr' => '', 'close' => 0], 'compare' => ['attr' => 'name,value,type', 'level' => 3, 'alias' => 'eq,equal,notequal,neq,gt,lt,egt,elt,heq,nheq'], 'range' => ['attr' => 'name,value,type', 'level' => 3, 'alias' => 'in,notin,between,notbetween'],