2017 © Pedro Peláez
 

library pager

A paginator library to split results into multiple pages

image

kgilden/pager

A paginator library to split results into multiple pages

  • Friday, November 10, 2017
  • by kgilden
  • Repository
  • 2 Watchers
  • 17 Stars
  • 8,377 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

Pager

Build Status Quality Packagist, (*1)

Pager is a library to split results to multiple pages - any way you want them!, (*2)

Features

  • 5 built-in adapters for arrays, Doctrine ORM, ElasticSearch & MongoDB;
  • safe subset of methods to not even count items;
  • strategies to split pages inequally (i.e. 2 last pages merged);
  • integrates nicely with Symfony's HttpKernel to infer the current page;
  • provides a bundle to seamlessly integrate with Symfony;

Documentation

Read the documentation, (*3)

Usage

Two objects work together to split a set of items to pages: pager and adapter. Pagers act as factories for pages. Adapters allow concrete item sets to be paged (for example there's an adapter for Doctrine queries)., (*4)

Here's an example with arrays (check out the docs for more):, (*5)

paginate(new ArrayAdapter($list), $itemsPerPage, $currentPage);

$page->isFirst(); // false
$page->isLast(); // true - there's a total of 3 pages
$page->getNumber(); // 3 - it's $currentPage

count($page->getItems()); // 1
$page->getItems(); // ["eggplant"]

?>

Installation

Install using composer: composer.phar require kgilden/pager, (*6)

Testing

Simply run phpunit in the root directory of the library for the full test suite., (*7)

License

This library is under the MIT license., (*8)

The Versions

10/11 2017
12/03 2016

v1.1.1

1.1.1.0

A library to split results into multiple pages

  Sources   Download

MIT

The Development Requires

library pagination paginator pager

22/12 2015

v1.1.0

1.1.0.0

A library to split results into multiple pages

  Sources   Download

MIT

The Development Requires

library pagination paginator pager

09/05 2015

v1.0.0

1.0.0.0

A library to split results into multiple pages

  Sources   Download

MIT

The Development Requires

22/03 2015

v1.0.0-beta1

1.0.0.0-beta1

A library to split results into multiple pages

  Sources   Download

MIT

The Development Requires

01/03 2015

v0.2.0

0.2.0.0

A library to split results into multiple pages

  Sources   Download

MIT

The Development Requires

25/02 2015

v0.1.0

0.1.0.0

A library to split results into multiple pages

  Sources   Download

MIT

The Development Requires