zoukankan      html  css  js  c++  java
  • TP框架中分页类的使用

     1 public function test(){
     2             $m=M('Message');
     3 
     4             import('ORG.Util.Page');// 导入分页类
     5             $count    = $m->count();// 查询满足要求的总记录数
     6             $page    = new page($count,3);// 实例化分页类 传入总记录数和每页显示的记录数
     7             $page->setConfig('header','条信息');
     8             $show = $page->show();// 分页显示输出
     9             $this->assign('page',$show);// 赋值分页输出
    10             $list  = $m->limit($page->firstRow.','.$page->listRows)->select();
    11             $this->assign('list',$list);// 赋值数据集
    12             $this->display();
    13         }
  • 相关阅读:
    spoj705
    bzoj2440
    spoj220
    bzoj2301
    hdu1695
    poj3294
    hdu3518
    poj3693
    函数
    样式
  • 原文地址:https://www.cnblogs.com/houmin0036/p/4821212.html
Copyright © 2011-2022 走看看