Home>Article>Backend Development> thinkPHP3.2.3 combines Laypage to implement paging function
这篇文章主要介绍了thinkPHP3.2.3结合Laypage实现的分页功能,结合实例形式分析了thinkPHP3.2.3结合Laypage实现分页的model控制器与view视图相关操作技巧,需要的朋友可以参考下
本文实例讲述了thinkPHP3.2.3结合Laypage实现的分页功能。分享给大家供大家参考,具体如下:
控制器
count())/10); $infos=D('data')->limit(($nowpage-1)*10,10)->select(); }else{ $totalpage=ceil((D('data')->where($c)->count())/10); $infos=D('data')->where($c)->limit(($nowpage-1)*10,10)->select(); } }else{ if($choose == -6) { $map['data'] = array('like',"%$type%"); $totalpage=ceil((D('data')->where($map)->count())/10); $infos=D('data')->where($map)->limit(($nowpage-1)*10,10)->select(); }else{ $map['data'] = array('like',"%$type%"); $totalpage=ceil((D('data')->where($map)->where($c)->count())/10); $infos=D('data')->where($map)->where($c)->limit(($nowpage-1)*10,10)->select(); } } $this->assign('type',$type); $this->assign('choose',$choose); $this->assign("totalpage",$totalpage); $this->assign("infos",$infos); $this -> display(); } }
视图层
Think Demo {$type} " id="type">
ID | 语言 | 难易程度 | 操作 |
---|---|---|---|
{$vo.id} | {$vo.data} | | 删除 修改 |
以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!
相关推荐:
The above is the detailed content of thinkPHP3.2.3 combines Laypage to implement paging function. For more information, please follow other related articles on the PHP Chinese website!