smarty section 循环不同的四个样式

<div class="moban_spzs">
<{section name=goodslist loop=$strdata6}>
<{if $smarty.section.goodslist.first}>
<div class="moban_spzsleft">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
<{elseif $smarty.section.goodslist.index<2}>
<div class="moban_spzscont">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
<{elseif $smarty.section.goodslist.index<3}>
<div class="moban_spzsright">
<div class="mobanright_div">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
<{elseif $smarty.section.goodslist.index<4}>
<div class="mobanright_div1">
<p><{$strdata6[goodslist].name}></p>
<dd>¥<{$strdata6[goodslist].price}></dd>
<a href=goods_details.php?id=<{$id}>&categoryId=<{$strdata2[goodslist].categoryId}>&cmid=<{$strdata6[goodslist].cmid}>><img src="<{$strdata6[goodslist].faceImg}>"alt=""></a>
</div>
</div>
<{/if}>
<{/section}>
</div>

posted @ 2018-07-29 22:58  阿波罗任先生  阅读(335)  评论(0编辑  收藏  举报