cycle function
cycle function:
If you need to use multiple rotations in the template, you need to give a unique name attribute .
Users can set the print attribute to false to force the current value not to be output. This feature can easily skip a certain value.
The advance attribute is used to reuse a certain value. When this attribute is set to false, the same value will be output the next time the rotation is called.
If the "assign" special Attribute, the output value of this rotation will be assigned to the template variable specified by assign instead of being output directly.
eg:
$ smarty->assign('data',array(1,2,3));
##{section name=rows loop=$data}< tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
<td>{$data[rows]}</td>
</tr>
{ /section}
Output:
<tr bgcolor="#eeeeee">
<td>1</td>
< ;/tr>
<tr bgcolor="#d0d0d0">
<td>2</td>
</tr>
<tr bgcolor="#eeeeee" >
<td>3</td>
</tr>
##