Download the PHP package makedo/php-paginator without Composer
On this page you can find all versions of the php package makedo/php-paginator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download makedo/php-paginator
More information about makedo/php-paginator
Files in makedo/php-paginator
Package php-paginator
Short Description Data source independent paginator for php
License MIT
Informations about the package php-paginator
Paginator
This is yet another paginator for php. Main idea of this package is to build data source independent paginator, which has an ability to work in several modes:
-
Count skip by id
In this example you have an ability use
idas skip value. As you can see, Loader function acceptsidin$skipvariable. It should beidof last item on previous page and it comes from client side. For 1st page it should be 0. For$page->hasNextpaginator will load$perPage + 1item, and then check if actual count of loaded items is more than$perPage.Optionally, you can set
$currentPagevalue, which will be set to$page->currentPage. -
Count skip by id with total count
In above example paginator counts skip by id and uses total count for
$page->total,$page->totalPagesvalues. For$page->hasNextpaginator will load$perPage + 1item, and then check if actual count of loaded items is more than$perPage. -
Count skip by id with total count and current page
In above example paginator counts skip by id and uses total count for
$page->total,$page->totalPages,$page->hasNextvalues. In this case, we know$currentPagevalue, which in real case comes from client, so we can use total count and$currentPagefor counting$page->hasNextexcept using$perPage + 1strategy. -
Count skip by offset
In above example paginator counts skip as offset according to $perPage and $currentPage values. For counting
$page->hasNextpaginator will load$perPage + 1item, and then check if actual count of loaded items is more than$perPage.- Count skip by offset and use total count
In above example paginator counts skip by offset and uses total count for
$page->total,$page->totalPages,$page->hasNextvalues.