天天看點

關于smarty.foreach 第一次、最後一次循環、長度

1、$smarty.foreach.fe_keyword_list.fist:循環第一次時

2、$smarty.foreach.fe_keyword_list.last:循環最後一次

3、$smarty.foreach.fe_keyword_list.total:長度

例子:

{if $smarty.foreach.foreach_name.fist}

    first

{else}

    {if $smarty.foreach.foreach_name.last}

        last

    {else}

        ...

    {/if}

{/if}