最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

smarty的section嵌套循環(huán)用法示例

 更新時(shí)間:2016年05月28日 11:54:38   作者:keyunq  
這篇文章主要介紹了smarty的section嵌套循環(huán)用法,結(jié)合簡(jiǎn)單實(shí)例形式分析了Smarty使用section進(jìn)行嵌套循環(huán)操作的實(shí)現(xiàn)技巧,需要的朋友可以參考下

本文實(shí)例講述了smarty的section嵌套循環(huán)用法。分享給大家供大家參考,具體如下:

{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>&nbsp;&nbsp;<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">數(shù)量:{$typeList[sec1].shop[sec2].num} 個(gè) </td>
      </tr>
      <tr>
       <td class="zi2" align="middle">價(jià)格:{$typeList[sec1].shop[sec2].price} 白金幣 </td>
      </tr>
    </table></td>
{/section}
    </tr>
</table>
{/section}

將sec1 的 $typeList[sec1].shop 作為sec2的loop

就可以取到shop其中的數(shù)組的內(nèi)容

更多關(guān)于Smarty相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《smarty模板入門基礎(chǔ)教程》、《PHP模板技術(shù)總結(jié)》、《PHP基于pdo操作數(shù)據(jù)庫(kù)技巧總結(jié)》、《PHP運(yùn)算與運(yùn)算符用法總結(jié)》、《PHP網(wǎng)絡(luò)編程技巧總結(jié)》、《PHP基本語(yǔ)法入門教程》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫(kù)操作入門教程》及《php常見(jiàn)數(shù)據(jù)庫(kù)操作技巧匯總

希望本文所述對(duì)大家基于smarty模板的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

乐业县| 九龙县| 绿春县| 安西县| 溧阳市| 朝阳区| 虞城县| 达州市| 原平市| 宜阳县| 天门市| 峨边| 民勤县| 高邑县| 砚山县| 商都县| 新郑市| 贵定县| 绩溪县| 合水县| 白朗县| 独山县| 同仁县| 双桥区| 大渡口区| 巴楚县| 合江县| 大渡口区| 海淀区| 长泰县| 景泰县| 乌拉特中旗| 宣化县| 永清县| 竹溪县| 合山市| 固安县| 康定县| 和田县| 怀化市| 宜宾市|