This is for backup.
eq = Equal Equal
NEQ = Not equal is not equal to
GT = Greater than greater than
lt = Less than less than
LTE = Less than or equal less than or equal
GTE = great than or equal is greater than or equal to
Not non-
MoD Take surplus
Div by IS ... Except
Is even is an even
is odd are odd
Are not even are not even
Are not odd are not odd
{$variable} variable
{if $grade eq "one"}
Hello one.
{ElseIf $grade eq "Two"}
Hello Teo.
{Else}
Hello anything.
{/if}
{literal}
<script language=javascript>
<!--
function Isblank (field) {
if (Field.value = = ")
{return false;}
Else
{
Document.loginform.submit ();
return true;
}
}
-->
</script>
{/literal}
{foreach from= $specification item=spec Key=spec_key}
{$spec. name}:<br/>
{if $spec. Attr_type eq 1}
{foreach from= $spec. Values Item=value Key=key}
<input type= "Radio" name= "spec_{$spec _key}" value= "{$value. ID}" id= "spec_value_{$value. ID}" {if $key eq 0}checked{/ If}/>
{$value. Label} [{if $value. Price GT 0}{$lang. Plus}{elseif $value. 0}{$lang. minus}{/if} {$value. format_price|abs}]<br/>
{/foreach}
<input type= "hidden" name= "Spec_list" value= "{$key}"/>
{Else}
{foreach from= $spec. Values Item=value Key=key}
<input type= "checkbox" Name= "spec_{$spec _key}" value= "{$value. ID}" id= "spec_value_{$value. ID}"/>
{$value. Label} [{if $value. Price GT 0}{$lang. Plus}{elseif $value. 0}{$lang. minus}{/if} {$value. format_price|abs}]<br/>
{/foreach}
<input type= "hidden" name= "Spec_list" value= "{$key}"/>
{/if}
{/foreach}
{if $grade eq "one"}
Hello one.
{ElseIf $grade eq "Two"}
Hello Teo.
{Else}
Hello anything.
{/if}
{literal}
<script language=javascript>
<!--
function Isblank (field) {
if (Field.value = = ")
{return false;}
Else
{
Document.loginform.submit ();
return true;
}
}
-->
</script>
{/literal}
{foreach from= $specification item=spec Key=spec_key}
{$spec. name}:<br/>
{if $spec. Attr_type eq 1}
{foreach from= $spec. Values Item=value Key=key}
<input type= "Radio" name= "spec_{$spec _key}" value= "{$value. ID}" id= "spec_value_{$value. ID}" {if $key eq 0}checked{/ If}/>
{$value. Label} [{if $value. Price GT 0}{$lang. Plus}{elseif $value. 0}{$lang. minus}{/if} {$value. format_price|abs}]<br/>
{/foreach}
<input type= "hidden" name= "Spec_list" value= "{$key}"/>
{Else}
{foreach from= $spec. Values Item=value Key=key}
<input type= "checkbox" Name= "spec_{$spec _key}" value= "{$value. ID}" id= "spec_value_{$value. ID}"/>
{$value. Label} [{if $value. Price GT 0}{$lang. Plus}{elseif $value. 0}{$lang. minus}{/if} {$value. format_price|abs}]<br/>
{/foreach}
<input type= "hidden" name= "Spec_list" value= "{$key}"/>
{/if}
{/foreach}
Smarty Mathematical Operations
{$foo +1}
{$foo * $bar}
{* Some more complicated examples *}
{$foo->bar-$bar [1]* $baz->foo->bar () -3*7}
{if ($foo + $bar. test% $baz *134232+10+ $b +10)}
{$foo |truncate: "' $fooTruncCount/$barTruncFactor-1 '"}
{Assign var= "foo" value= "' $foo + $bar '"}
In the template
Mathematical operations can be applied directly to variables
$smarty->assign (' a ', 11);
$smarty->display (' 111.html ');
{$a *4}
{$foo +1} {$foo * $bar} {* Some more complicated examples *} {$foo->bar-$bar [1]* $baz->foo->bar () -3*7} {if ($foo + $bar. test% $baz *134232+10+ $b +10)} {$foo |truncate: "' $fooTruncCount/$barTruncFactor-1 '"} {Assign var= "foo" value= "' $foo + $bar '"}