Basic prototype:
{Section name = name loop = $ varName [, start = $ start, step = $ step, max = $ max, show = true]}
Name: section name, no need to add $
$ Loop: The variable to be recycled. in the program, use assign to operate the variable.
$ Start: subscript of the start loop. The subscript of the loop starts from 0 by default.
$ Step: increment of the mark in each loop
$ Max: Maximum loop subscript
$ Show: boolean type. determines whether to display this block. The default value is true.
Here is a glossary:
Loop subscript: Actually, its English name is index, which means index. Here I translate it into "subscript" for better understanding. It indicates the current loop index when the loop block is displayed. The default value starts from 0 and is affected by $ start. If $ start is set to 5, it will also count from 5, we used it in the template design section. This is an attribute of the current {section} and the call method is Smarty. section. sectionName. index. Here, sectionName refers to the name attribute in the function prototype.
The attribute values of the {section} block are:
1. index: the "loop subscript" introduced above. The default value is 0.
2. index_prev: the first value of the current underlying object. The default value is-1.
3. index_next: The next value of the current underlying object. The default value is 1.
4. first: whether it is the first next loop
5. last: whether it is the last loop
6. iteration: number of cycles
7. rownum: current row number, another alias of iteration
8. loop: the last cycle number, which can be used to count the number of cycles of a section after the section Block.
9. total: number of cycles. The number of cycles can be counted after the section.
10. show: it is included in the function declaration to determine whether the section is displayed.