11. Qualifier Smarty Syntax PHP Equivalent
== $a eq $b ==
!= $a neq $b !=
> $a gt $b >
< $a lt $b <
>= $a ge $b >=
<= $a le $b <=
=== $a === 0 ===
! not $a !
% $a mod $b %
Is [not] divisible by $a is not div by $b $a % $b == 0
Is [not] even $a is not even $a % 2 == 0
Is [not] even by $a is not even by $b ($a/$b)%2==0
Is [not] odd $a is not odd $a % 2 != 0
Is [not] odd by $a is not odd by $b ($a/$b)%2!=0
12. {if}{elseif}{else}
{if $name eq 'Blog'}
{* do something *}
{elseif $name eq $foo}
{* do something else *}
{/if}
{if is_array($foo) and count($foo) > 0}
{* do a foreach loop *}
{/if}
15. {php}
{php}
global $foo, $bar;
if($foo == $bar){
echo 'This will be sent to browser';
}
$this->assign(‘flavor',‘Chocolate');
{/php}
{$flavor} is my fav ice cream :-)