牛骨文教育服务平台(让学习变的简单)

index

index is used to display the current loop index, starting with zero (or the start attribute if given), and incrementing by one (or by the step attribute if given.)

index 用于显示当前循环的索引,从0开始(如果指定了start属性,那么由该值开始),每次加1(如果指定了step属性,那么由该值决定).

Technical Note: If the step and start section properties are not modified, then this works the same as the iteration section property, except it starts on 0 instead of 1.

技术细节:如果没有指定step和start属性,此值的作用和iteration类似,只不过从0开始而已.

Example 7-21. section property index
例 7-21. section 的 index 属性演示

	{section name=customer loop=$custid}
	{$smarty.section.customer.index} id: {$custid[customer]}<br>
	{/section}


	OUTPUT:

	0 id: 1000<br>
	1 id: 1001<br>
	2 id: 1002<br>