Conditional Judgment statements (these statements are written in the Smarty template)
{if $name eq ' Tom '}
Welcome Sir
{elseif $name eq ' Wilma '}
Welcome Ma ' am
{Else}
Welcome,whatever Yu is
{/if}
Note: Start with an If, end with/if, format fixed;
EQ modifier, equivalent to ' = = '
NEQ, the equivalent of '! = ';
GT, equivalent to ' > ';
LT, equivalent to ' < ';
Circular Statement Section
1. More functions, more parameters. Smarty one of the functions used to do cyclic operations
2. Basic attribute Name,loop
For example, an array is a two-dimensional array $arr = array (' Age ' = ' ~ ', ' job ' = ' computer '), Array (' age ' = ' + ', ' job ' = ' music ');
{section Name=mark loop= $arr}
{$arr [Mark].age}
{$arr [Mark].job}
<br/>
{/section}
As you can see, the format is fixed; name equals an assignment subscript, loop specifies the array to loop the output
3.section Other properties
3.1start the starting position of the loop;
3.2step determines the step size of the loop, such as step=2, and only iterates through the elements labeled 0,2,4, etc.
3.3max set the number of executions for the loop
3.4show determines whether the loop is displayed
Template Engine Smarty II