thinkphp 3.2之分页
2021-07-12 05:06
标签:控制器 splay 控制 thinkphp pre sign php logs select 控制器中代码: 模板代码: thinkphp 3.2之分页 标签:控制器 splay 控制 thinkphp pre sign php logs select 原文地址:http://www.cnblogs.com/lubenxin/p/7083075.html 1 $demo=D(‘demo‘);
2 $count= $demo->count();
3 $Page= new \Think\Page($count,9);
4 $Page->setConfig(‘header‘, ‘‘);
5 $Page->setConfig(‘prev‘,‘上页‘);
6 $Page->setConfig(‘next‘,‘下页‘);
7 $Page->setConfig(‘first‘,‘首页‘);
8 $Page->setConfig(‘last‘,‘末页‘);
9 // $Page->setConfig(‘theme‘, ‘%FIRST%%UP_PAGE%%LINK_PAGE%%DOWN_PAGE%%END%%HEADER%‘);
10 $show = $Page->show();
11 $list = $demo->order(‘id‘)->limit($Page->firstRow.‘,‘.$Page->listRows)->select();
12 $this->assign(‘list‘,$list);
13 $this->assign(‘page‘,$show);
14 $this->display();