iteration

PHP Smarty

Smarty - the compiling PHP template engine
Prev 来源:PHP中文社区 Next

iteration

	{section name=customer loop=$custid start=5 step=2}
	current loop iteration: {$smarty.section.customer.iteration}<br>
	{$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}


	OUTPUT:

	current loop iteration: 1
	5 id: 1000<br>
 	The customer id will change<br>
	current loop iteration: 2
	7 id: 1001<br>
 	The customer id will change<br>
	current loop iteration: 3
	9 id: 1002<br>
 	The customer id will change<br>

Prev 来源:PHP中文社区 Home Next
index_next Up first