2017 © Pedro Peláez
 

library pagination

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See ViewBase Class.

image

rayful/pagination

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See ViewBase Class.

  • Monday, September 18, 2017
  • by kingmaxyang
  • Repository
  • 1 Watchers
  • 2 Stars
  • 373 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 17 % Grown

The README.md

Pagination

一个简单通用分页类。包含分页器类(Pagination)及显示类(在View命名空间下,可通过继承ViewBase类进行扩展及自定义显示逻辑及CSS样式)。, (*1)

安装

composer install rayful/pagination

Pagination Interface 接口能力

interface PaginationInterface
{
    /**
     * 返回总共有多少条记录
     * @return int
     */
    public function getTotalRecord();

    /**
     * 返回每页限制显示多少条记录
     * @return int
     */
    public function getLimitRecord();

    /**
     * 返回这次查询该跳过多少条记录(数据库查询用,根据每页条数、当前页两个当前属性计算得出)
     * @return int
     */
    public function getSkipRecord();

    /**
     * 总共有多少页
     * @return int
     */
    public function getTotalPage();

    /**
     * 第一页的页码
     * @return int
     */
    public function getFirstPage();

    /**
     * 当前页的页码
     * @return int
     */
    public function getCurrentPage();

    /**
     * 最后一页的页码
     * @return int
     */
    public function getEndPage();

    /**
     * 下一页的页码
     * @return int
     */
    public function getNextPage();

    /**
     * 上一页的页码
     * @return int
     */
    public function getPrevPage();

    /**
     * 根据新页码输出新的URL
     * @param int $page 新页码
     * @param string $url 当前URL,如果不传入,将默认将自动读取$_SERVER全局变量
     * @return array
     */
    public function getNewURL($page, $url = null);
}

界面相关


<nav aria-label="...">
    <ul class="pager">
        <?php
        echo new \rayful\Tool\Pagination\Bootstrap3\AlignedViewCN($pagination);
        ?>
    </ul>
</nav>

界面类说明

Bootstrap3 命名空间:\rayful\Tool\Pagination\Bootstrap3\

  • AlignedViewCN: [https://getbootstrap.com/docs/3.3/components/#pagination-pager]
  • ListingView:[https://getbootstrap.com/docs/3.3/components/#pagination-default]
  • SimpleViewEN/SimpleViewCN:[https://getbootstrap.com/docs/3.3/components/#pagination-pager]

Bootstrap4 命名空间:\rayful\Tool\Pagination\Bootstrap4\

  • ListingView:[https://getbootstrap.com/docs/4.0/components/pagination/]
  • SimpleViewEN/SimpleViewCN:样式请见test文件

自定义:请扩展ViewBase类,实现display()方法,可自定义显示逻辑及CSS和HTML样式。

The Versions

18/09 2017

dev-master

9999999-dev

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See ViewBase Class.

  Sources   Download

The Requires

 

by Kingmax Yang

18/09 2017

2.01

2.01.0.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See ViewBase Class.

  Sources   Download

The Requires

 

by Kingmax Yang

14/08 2017

2.0

2.0.0.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See ViewBase Class.

  Sources   Download

The Requires

 

by Kingmax Yang

18/06 2017

1.04

1.04.0.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

16/06 2017

1.03

1.03.0.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

29/04 2016

1.0.2

1.0.2.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

22/04 2016

1.0.0

1.0.0.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

22/04 2016

1.0.1

1.0.1.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

22/04 2016

0.1.2

0.1.2.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

22/04 2016

0.1.3

0.1.3.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

22/04 2016

0.1.1

0.1.1.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang

21/04 2016

0.1.0

0.1.0.0

A Library for Pagination, interagted in DB-Manager. Can be extended to change display, can See MorePage Class.

  Sources   Download

The Requires

 

by Kingmax Yang