smarty template engine
Tuesday, January 06, 2009  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


first

first is set to true if the current section iteration is the first one.

Example 7-25. section property first

	{section name=customer loop=$custid}
	{if $smarty.section.customer.first}
    	<table>
	{/if}

	<tr><td>{$smarty.section.customer.index} id:
        	{$custid[customer]}</td></tr>

	{if $smarty.section.customer.last}
    	</table>
	{/if}
	{/section}


	OUTPUT:

	<table>
	<tr><td>0 id: 1000</td></tr>
	<tr><td>1 id: 1001</td></tr>
	<tr><td>2 id: 1002</td></tr>
	</table>



 

credits 

Smarty Copyright © 2002-2008
New Digital Group, Inc.

All rights reserved.