我想要的效果是 id=1 周末的聚會(huì)。。。。 然后是后面的? id=1026 教師節(jié)福利大放送。。。。后面的那些就是這種的效果,希望大神垂愛(ài)我這是兩張表,標(biāo)題屬于表一,其他的屬于表二圖片是我出來(lái)的效果,可是我只想讓他出來(lái)一遍,應(yīng)該用什么循環(huán)這是前臺(tái)代碼<table class="tablelist">? ? <thead>? ? <tr>? ? ? ? <th><input name="" type="checkbox" value="" checked="checked"/></th>? ? ? ? <th>編號(hào)<i class="sort"><img src="__PUBLIC__/images/px.gif" /></i></th>? ? ? ? <th>標(biāo)題</th>? ? ? ? <th>飯店名稱</th>? ? ? ? <th>飯店分類</th>? ? ? ? <th>飯店屬性</th>? ? ? ? <th>所在區(qū)</th>? ? ? ? <th>地址</th>? ? ? ? <th>電話</th>? ? ? ? <th>操作</th>? ? ? ? </tr>? ? ? ? </thead>? ? ? ? <tbody>? ? ? ??? ? ? ? ?<tr>? ? ? ??? ? ? ??? ? <foreach name='rest' item='v'>? ? <foreach name='mat' item='value'>? ? <tr>? ? ? ? <td><input name="" type="checkbox" value="" /></td>? ? ? ? ?<td>{$v.id}</td>??? <td>{$value.title}</td>?? ? ? ? <td>{$v.name}</td>? ? ? ? <td>{$v.type}</td>? ? ? ? <td>{$v.attr}</td>? ? ? ? <td>{$v.area}</td>? ? ? ? <td>{$v.address}</td>? ? ? ? <td>{$v.phone}</td>? ? ? ? <td><a href="#" class="tablelink">修改</a> ? ? <a href="#" class="tablelink"> 刪除</a></td>? ? </tr>? ? ?</foreach></foreach>? ? ? ? </tr>?? ? ? ??? ? ? ??? ? ? ? </tbody>? ? </table>這是后臺(tái)查詢代碼? ? ? $this->mat=M('weixin_materials')->limit(2)->select();? ? ? ?$this->rest=M('restaurants')->select();我的問(wèn)題就是前臺(tái)應(yīng)該用什么循環(huán),才能讓他只顯示一次而不是現(xiàn)在的每個(gè)id都顯示兩遍
thinkphp循環(huán)問(wèn)題,請(qǐng)各位大神抽空回答一下下
初學(xué)乍練2
2016-11-14 09:57:53