触摸屏租赁
Touch screen rental
广告机租赁
Advertising rental
机器人租赁
Robot leasing
 当前位置:首页 > > ECShop foreach设定循环次数的方法

方法一:
<!--{foreach from=$cat_goods_2 item=goods name="cat_goods_2"}-->
<!--{if $smarty.foreach.cat_goods_2.iteration <= 6}-->
<div class="textleft">·<a target=_blank  href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.name|escape:html}
<span class="p1 font">
<!-- {if $goods.promote_price neq ""} -->
{$goods.promote_price}
<!-- {else}-->
{$goods.shop_price}
<!--{/if}-->
</span></a></div>
<!---{/if}-->
<!--{/foreach}--> 

方法二:
<!--{foreach from=$cat_goods_1 item=goods name="cat_goods_1"}-->
<!-- {if $smarty.foreach.cat_goods_1.index lt 6} **文章显示数量 -->
<div class="textleft">·<a target=_blank  href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.name|escape:html}
<span class="p1 font">
<!-- {if $goods.promote_price neq ""} -->
{$goods.promote_price}
<!-- {else}-->
{$goods.shop_price}
<!--{/if}-->
</span></a></div>
<!---{/if}-->
<!--{/foreach}-->


工作室地址:重庆石桥铺电脑城B座 | 微信:z35544216 | 网址:www.35544216.com