smarty中的if语句和php中的if语句一样,if必须与/if成对出现。可以使用else和elseif子句。
可以使用条件修饰词:eq、ne、neq、gt、lte、le、gte、ge、is even、is odd、is not even、is not odd、not、
mod、div by、even by、odd by、  ==、!= 、>、<=、>=、使用修饰词要和变量或常量用空格隔开
例子:
{if $name eq "fred"}
welcome sir.
{elseif $name eq "wilma"}
welcome ma'am.
{else}
welcome
{/if}

相关文章:

  • 2021-10-17
  • 2022-12-23
  • 2021-11-29
  • 2022-02-03
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-04-20
相关资源
相似解决方案