Mar182012
smarty中foreach索引
作者:黑♂白 发布:2012-03-18 17:28:27 分类: web后端
使用smarty模板时偶尔会用到索引,因用的时候不是很多,很容易忘记,在此做个记号。
{foreach name=top from=$top_goods item=goods}
{$smarty.foreach.top.iteration}
<a href="/{$goods.url}" title="{$goods.name|escape:html}">
<img src="/{$goods.goods_img}" alt="{$goods.name|escape:html}"/></a>
{/foreach}
这里 $smarty.foreach.top.iteration 就是smarty foreach取得索引的方法。
smarty中foreach索引:目前有1 条留言
发表评论
您还未登录,需要登录后才能发言
学习一下了啊
2012-03-19 12:04:38那以后多来学习。
2012-03-19 12:57:02