last
last is set to true if the current section iteration is the last one.
如果当前循环执行到最后一次,last 被设置为true.
Example 7-26. section property last
例 7-26. section 的 last 属性演示
{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>
|
|