免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
TP5的內(nèi)置循環(huán)標(biāo)簽
循環(huán)標(biāo)簽語(yǔ)法
在index.html中:
<!DOCTYPE html><html lang="en"><head> <meta charset = "UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title></head><body> <p>index模塊index控制器index操作對(duì)應(yīng)模板</p> <table border="1" cellspacing="0" cellpadding="2" width="40%"> <caption style="font-size:22px;font-weight:bold">員工信息表</caption> <tr style="background-color:#83daf1"> <th>編號(hào)</th> <th>姓名</th> <th>性別</th> <th>年齡</th> <th>工資</th> </tr> <!-- volist循環(huán) --> {volist name="user" id="vo" key='k' offset="2" length="5" empty="沒(méi)有數(shù)據(jù)"} <tr> <td>{$k}</td> <td>{$vo.name}</td> <td>{$vo.sex}</td> <td>{$vo.age}</td> <td>{$vo.salary}</td> </tr> {/volist} </table></body></html><!-- foreach循環(huán) -->{foreach name="user" item="value"}<tr> <td>{$key}</td> <td>{$value.name}</td> <td>{$value.sex}</td> <td>{$value.age}</td> <td>{$value.salary}</td> </tr>{/foreach}<!-- for循環(huán) -->{for start='0' end='10' comparsion='lt' name='i' step='1'} <tr> {for start='0' end='5' comparsion='lt' name='j' step='1'} <td>{$j*5+$i}</td> {/for} </tr>{/for}
總結(jié):循環(huán)標(biāo)簽有三種語(yǔ)法,各自有不同的用途:volist適合輸出格式較復(fù)雜的數(shù)據(jù),foreach語(yǔ)法簡(jiǎn)單,適合輸出簡(jiǎn)單數(shù)據(jù),for標(biāo)簽適合輸出大量重復(fù)樣式,不適合數(shù)據(jù)輸出,具體要哪個(gè),還要看項(xiàng)目需求~~
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
HTML <table> 標(biāo)簽
表格標(biāo)簽
ThinkPHP中的數(shù)組改造及<volist>標(biāo)簽嵌套循環(huán)
Thinkphp中的volist標(biāo)簽用法簡(jiǎn)介
HTML中tr、th和td
<col> 標(biāo)簽
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服