這篇文章給大家介紹怎么在smarty中使用實現section嵌套循環,內容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
具體如下:
{section name="sec1" loop=$typeList}
<TABLE class=left20 height=25 cellSpacing=0 cellPadding=0 width=624
background=images/indexbg.gif border=0>
<TBODY>
<TR>
<TD class=zi align=left width=554 height=25> <FONT
color=#ffffff><B>{$typeList[sec1].typeName}</B></FONT></TD>
<TD vAlign=top width=70 height=25><a href="hot.html"><IMG src="images/more.gif" width="53" height="25"
border=0></a></TD>
</TR></TBODY></TABLE>
<table cellspacing="0" cellpadding="0">
<tr>
{section name="sec2" loop=$typeList[sec1].shop}
<td><table cellspacing="0" cellpadding="0">
<tr>
<td valign="center" align="middle" width="116"><table cellspacing="0" cellpadding="0">
<tr>
<td><a href="show_prop.php?id={$typeList[sec1].shop[sec2].id}" target="_blank"><img src="http://localhost/{$typeList[sec1].shop[sec2].img_url}" width="84" height="88" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td class="hongzi" align="middle"> <a href="a01.htm">{$typeList[sec1].shop[sec2].name} </a> </td>
</tr>
<tr>
<td class="zi2" align="middle">數量:{$typeList[sec1].shop[sec2].num} 個 </td>
</tr>
<tr>
<td class="zi2" align="middle">價格:{$typeList[sec1].shop[sec2].price} 白金幣 </td>
</tr>
</table></td>
{/section}
</tr>
</table>
{/section}關于怎么在smarty中使用實現section嵌套循環就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。