dkx / paginator
This package is abandoned and no longer maintained.
No replacement package was suggested.
Paginator with paginator factory
0.2.1
2019-11-02 11:20 UTC
Requires
- php: >=7.3
Requires (Dev)
- mockery/mockery: ^1.2
- phpstan/extension-installer: >=1.0
- phpstan/phpstan: >=0.11
- phpstan/phpstan-phpunit: >=0.11
- phpstan/phpstan-strict-rules: >=0.11
- phpunit/phpunit: >=8.0
This package is auto-updated.
Last update: 2024-01-29 03:27:59 UTC
README
Paginator with factory
Installation
$ composer require dkx/paginator
Usage
<?php
use DKX\Paginator\PaginatorFactory;
$itemsPerPage = 20;
$base = 1;
$factory = new PaginatorFactory();
$factory->setItemsPerPage($itemsPerPage);
$factory->setBase($base);
$totalCount = 5000;
$currentPage = 3;
$paginator = $factory->create($totalCount, $currentPage);
PaginatedData
PaginatedData
is a class which can wrap data from database and add information about pagination.
<?php
use DKX\Paginator\PaginatedData;
$data = $repository->getUsers();
$paginatedData = new PaginatedData($paginator, $data);