Smarty if else /if判斷
if语句和和条件同php差不多, 但每个词之间必须用空格分割开。 也有一些新的条件语句, 列举如下: eq相等, ne、neq不相等, gt大于, lt小于, gte、ge大于等于, lte、le 小于等于, not非, mod求模。 is [not] div by是否能被某数整除, is [not] even是否为偶数, $a is [not] even by $b即($a / $b) % 2 == 0, is [not] odd是否为奇, $a is not odd by $b即($a / $b) % 2 != 0 示例: {if $name eq "Peter"} Welcome male. {elseif $name eq "Fengfeng"} Welcome female. {else} Welcome, whatever you are. {/if}