PHPackages                             minmb/php-paginator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. minmb/php-paginator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

minmb/php-paginator
===================

An extensible PHP pagination library

099PHP

Since Nov 6Pushed 13y ago1 watchersCompare

[ Source](https://github.com/minmb/PHP-Paginator)[ Packagist](https://packagist.org/packages/minmb/php-paginator)[ RSS](/packages/minmb-php-paginator/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHP-Paginator, an extensible paginator library for PHP
======================================================

[](#php-paginator-an-extensible-paginator-library-for-php)

PHP-Paginator is a simple library. It's inspired by the Django's pagination and this [tutorial](http://www.sitepoint.com/perfect-php-pagination/), following the best practices from the [Symfony2](http://symfony.com) community.

Installation
------------

[](#installation)

First clone the repository with the dependencies:

```
git clone git://github.com/minmb/PHP-Paginator.git
cd PHP-Paginator
git submodule init
git submodule update

```

Documentation
-------------

[](#documentation)

The goal of PHP-Paginator is to be as long as possible independent from the database engine and ORM used by the end user, in fact, you can use it even for paginate data fetched from other sources rather than a database. In order to have this flexibility PHP-Paginator can't be used directly in your project but with a minimal setup you will be ready to go.

The library is composed by four types of objects:

1. A Paginator object: The object that manages the pagination
2. A Page object: The representation as a page of data
3. A Paginated object: This object is the cornerstone of the library, and the one you will to use must. It is passed to the paginator and is responsible of fetching the data from the source you want
4. A Layout object: This object is responsible of managing the representation (as html or any format you want) of the navigation links of the paginator.

PHP-Paginator has a Paginator, Page, SimpleLayout and PaginatedArray out of the box:

```
