2017 © Pedro Peláez
 

library ddv-page

ddv-page php library

image

ddvphp/ddv-page

ddv-page php library

  • Tuesday, June 19, 2018
  • by yuchonghua
  • Repository
  • 4 Watchers
  • 0 Stars
  • 347 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 9 % Grown

The README.md

ddv-page

Installation - 安装

composer require ddvphp/ddv-page

Usage - 使用

1、laravel framework Usage[laravel 框架 使用]


$data = \App\Model\UploadBaseModel::where('file_id','<',70); return json_encode(new \DdvPhp\DdvPage($data));

$data = \App\Model\UploadBaseModel::where('file_id','<',70); return json_encode(new \DdvPhp\DdvPage($data, true));
$pageSize = 20 ; //每页条数

$data = \App\Model\UploadBaseModel::where('file_id','<',70)->paginate($pageSize, $columns, 'pageNow', $pageNow);

return json_encode(new \DdvPhp\DdvPage($data));

2、CodeIgniter framework Usage[CodeIgniter 框架 使用]

$page = new /DdvPhp/DdvPage();
$pc = array();
//传入当前的页数
$pc['now'] = $page_now;
//传入数据库总数据条数
$pc['count'] = $r['count'];
//每页多少条
$pc['size'] = $page_size;
//初始化分页配置
$pr = $page->init($pc);
//获取分页结果数据
$limit = $page->getLimit();
//获取limit的参数
$sql = '.......limit $limit[0],$limit[1] ....... ;';

//获取分页结果数据
$pr = $page->getPage();
$sql = '.......limit $pr["limitStart"],$pr["size"] ....... ;';
$pr格式
array(
    //当前页数
    'now'=>1,
    //输入的页数
    'input_page'=>1,
    //数据库数据总条数
    'count'=>0,
    //每页显示条数
    'size'=>10,
    //最后一页是第几页
    'end'=>10,
    //上一页页数是
    'before'=>1,
    //下一页页数是
    'after'=>1,
    //默认页数列条数
    'lists_size'=>10,
    //页数列表
    'lists'=>array(),
    //是否为传入的页数
    'is_input_page'=>true,
    //是否到达尾页
    'is_end'=>false,
    //limit开始位置
    'limit_start'=>0
)

The Versions

19/06 2018

dev-master

9999999-dev

ddv-page php library

  Sources   Download

MIT LGP-2.1

The Requires

  • php >=5.3

 

by Avatar yuchonghua
by zengfangyao

19/06 2018

0.0.1

0.0.1.0

ddv-page php library

  Sources   Download

MIT LGP-2.1

The Requires

  • php >=5.3

 

by Avatar yuchonghua
by zengfangyao