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中设置多语言切换
  • 热门搜索
    spc是什么意思 无问西东是什么意思 庹在姓氏上读什么 德玛西亚是什么意思 梦到鬼是什么意思 黑枸杞有什么功效 导盲犬是什么狗 中国的国花是什么 阴囊是什么 gold是什么意思