ThinkPHP3.2.3 文章加分页

 时间:2024-10-17 22:49:46

1、找到“根目录下\项目名\Home\View\”中的“index.html”

ThinkPHP3.2.3 文章加分页

2、代码如下:{$page}

ThinkPHP3.2.3 文章加分页

3、找到“根目录下\项目名\Home\Controller”中的“IndexController.class.php”

ThinkPHP3.2.3 文章加分页

4、代码如下:<?phpnamespace Home\Controller;use Think\Controller;class IndexController extends Controller { public function index(){ $Article = M('Goods'); // 实例化数据对象 $where['e']='茶'; $count = $Article->where($where)->count();// 查询满足要求的总记录数 $Page = new \Think\Page($count, 10);// 实例化分页类 $show = $Page->show();// 分页显示输出 $orderby['e']='desc';// 排序条件 $list = $Article->where($where)->order($orderby)->limit($Page->firstRow.','.$Page->listRows)->select(); $this->assign('list',$list);// 赋值数据集 $this->assign('page',$show);// 赋值分页输出 $this->display(); // 输出模板 }}

ThinkPHP3.2.3 文章加分页

5、大功告成,O(∩_∩)O~~

ThinkPHP3.2.3 文章加分页
  • thinkPHP3.2怎么分页输出
  • thinkPHP3.2.3框架如何实现分页功能?技巧讲解
  • ThinkPHP3.2.3 搜索功能
  • 分页使用laravel框架
  • thinkphp3.2.3中设置多语言切换
  • 热门搜索
    全国智力运动会 金丝皇菊的功效与作用 什么是鸡皮肤 蓝莓酒的功效与作用 人参的作用与功效 强的松的作用 姘头什么意思 拔罐作用 什么是swot分析法 lol手游国服什么时候上线