选择语言 :

Core_Pagination

分页核心类

使用方法举例

 # 配置默认值见 pagination.config.php 配置

 $pageconfig = array
 (
     'source'         => 'default',                //可不设置,默认值:default,可选query_string,route和default
     'key'            => '0',                      //指定参数位置,通常source为default时,key都为0,若source为query_string或route时,通常为page
     'items_per_page' => 20,                       //可不设置,默认值20
     'view'           => 'pagination/basic',       //可不设置,默认值pagination/basic
     'auto_hide'      => true,                    //可不设置,默认值true
 );

若不设置,则全为默认值,例如:$pagination = new Pagination();

  $pagination = new Pagination($pageconfig);
  $offset     = $pagination->offset();
  $limit      = $pagination->items_per_page();

通过$offset和$limit获取指定分页数据

  $data = Database::instance()->limit($limit, $offset)->get()->as_array();

API - Core_Pagination

author
呼吸二氧化碳 jonwang@myqee.com
category
MyQEE
package
System
subpackage
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

Pagination::factory( $config = 'default')

返回一个实例化对象的分页类