zoukankan      html  css  js  c++  java
  • thinkphp分页实例

    public function index() {
    
    		import ( 'ORG.Util.Page' );
    
    		$m = D ( "Tx_record" );
    
    		
    
    		$count = $m->count (); // 查询满足要求的总记录数
    
    		$Page = new Page ( $count, 10 ); // 实例化分页类 传入总记录数和每页显示的记录数
    
    		$Page -> setConfig('header', '条记录');
    
            $Page -> setConfig('theme', '<li><a>%totalRow% %header%</a></li> <li>%upPage%</li> <li>%downPage%</li> <li>%first%</li>  <li>%prePage%</li>  <li>%linkPage%</li>  <li>%nextPage%</li> <li>%end%</li> ');//(对thinkphp自带分页的格式进行自定义)
    
    		$show = $Page->show (); // 分页显示输出
    
    		
    
    		$result = $m->limit ( $Page->firstRow . ',' . $Page->listRows )->order("id desc")->relation(true)->select ();
    
    		$this->assign ( "result", $result );
    
    		$this->assign ( "page", $show ); // 赋值分页输出
    
    		$this->display ();
    
    	}
    

     

  • 相关阅读:
    Mac OS X开发学习 -打开文件选择器并获取文件
    Mac OS X开发学习
    第三方开源
    Xcode操作
    Mac操作
    XCode6.1 错误
    ios 本地推送
    IOS 语法
    IOS 其他
    IOS 语法
  • 原文地址:https://www.cnblogs.com/lvchenfeng/p/5204525.html
Copyright © 2011-2022 走看看