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"}">
{$data[rows]}

{ /section}


Output:

1
< ;/tr>

2


3



##

Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!