HBcms是一个用Pear框架+Smarty模板引擎构架的cms项目,欢迎大家参与制作Smarty模板

index_next

index_next is used to display the next loop index. On the last loop, this is still one more than the current index (respecting the setting of the step attribute, if given.)

index_next 用于显示下一个循环索引值. 循环执行到最后一次时,此值仍然比当前索引值大1(如果指定了step,取决于此值).

Example 7-23. section property index_next
Smarty手册范例 7-22. section 的 index_next 属性演示

	{section name=customer loop=$custid}
	{$smarty.section.customer.index} id: {$custid[customer]}<br>
	{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
	{if $custid[customer.index_next] ne $custid[customer.index]}
 	The customer id will change<br>
	{/if}
	{/section}


	输出结果:

	0 id: 1000<br>
 	The customer id will change<br>
	1 id: 1001<br>
 	The customer id will change<br>
	2 id: 1002<br>
 	The customer id will change<br>
这是一份简单的Smarty手册和Smarty教材,熟练掌握Smarty模板,让您做项目事半功倍