又谁知道smarty中 switch语句的写法?还是smarty不支持switch语句?

2025-04-13 10:34:28
推荐回答(1个)
回答1:

smarty不支持withch语句的。因为他毕竟不是一门专业的语言,仅仅只是一个框架。

你可以选择使用IF来操作

{if $goods.number eq 1}
HTML代码1
{elseif $goods.number eq 2}
HTML代码2
{else}
HTML代码其它
{/if}