index_prev

index_prev is used to display the previous loop index. on the first loop, this is set to -1.

Example 7-22. section property index_prev

	{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_prev] ne $custid[customer.index]}

    	The customer id changed<br>

	{/if}

	{/section}





	OUTPUT:



	0 id: 1000<br>

    	The customer id changed<br>

	1 id: 1001<br>

    	The customer id changed<br>

	2 id: 1002<br>

    	The customer id changed<br>