first
first is set to true if the current section iteration is the first one.
如果当前循环第一次执行,first 被设置为true.
Example 7-25. section property first 例7-25. section 的 first 属性演示
{section name=customer loop=$custid} {if $smarty.section.customer.first} {/if} {$smarty.section.customer.index} id: {$custid[customer]} | {if $smarty.section.customer.last} {/if} {/section} OUTPUT: 0 id: 1000 | 1 id: 1001 | 2 id: 1002 | |
|