首页 > Web开发 > 详细

ThinkPHP3.2 volist嵌套循环显示原理

时间:2015-10-20 11:44:40      阅读:227      评论:0      收藏:0      [点我收藏+]
php页面:
$fatherList = $Document->where(‘pid=1‘)->select();
        foreach($fatherList as $n=> $val)
        {
            $fatherList[$n][‘childList‘]=D(‘Document‘)->where(‘category_id=\‘‘.$val[‘id‘].‘\‘‘)->select();
                //$Baojia->where(‘belongto=\‘‘.$val[‘name‘].‘\‘‘)->select();
        }
        $this->assign(‘fatherList‘,$fatherList);


html页面:
<volist name="fatherList" id=‘data‘>
       <dl>
                 <dt class="active">{$data.title}</dt>
                 <dd style="display:block;">
                      <volist name="data[‘childList‘]" id="vo">
                            <a class="active" title="简介" href="http://youlanzihun.blog.163.com/">·{$vo.title}</a>
                     </volist>
                </dd>
      </dl>

</volist>
 转自:http://youlanzihun.blog.163.com/blog/static/3731171020142214112126/

ThinkPHP3.2 volist嵌套循环显示原理

原文:http://www.cnblogs.com/lvchenfeng/p/4894124.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!