Home>Article>Backend Development> thinkPHP3.2.3 combines Laypage to implement paging function

thinkPHP3.2.3 combines Laypage to implement paging function

不言
不言 Original
2018-06-07 16:37:59 1648browse

这篇文章主要介绍了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中文网!

相关推荐:

thinkPHP中统计排行与分页显示的功能

thinkphp实现分页显示功能

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn