PHPackages                             alexandresalome/pagination - 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. alexandresalome/pagination

Abandoned → [pagerfanta/pagerfanta](/?search=pagerfanta%2Fpagerfanta)Library[Utility &amp; Helpers](/categories/utility)

alexandresalome/pagination
==========================

Pager and pagination library

v0.1.0(12y ago)115772PHPPHP &gt;=5.3.3

Since Jul 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/alexandresalome/pagination)[ Packagist](https://packagist.org/packages/alexandresalome/pagination)[ RSS](/packages/alexandresalome-pagination/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Pagination
==========

[](#pagination)

[![Build status](https://camo.githubusercontent.com/f26fa26de8947b545f7a4c6b8537629505827cd31427124974888bd449fef928/68747470733a2f2f7472617669732d63692e6f72672f616c6578616e64726573616c6f6d652f706167696e6174696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/alexandresalome/pagination)**Requirements**: PHP 5.3

**DEPRECATED**: this library is deprecated. It is recommended to use pagerfanta.

Personal library used to paginate stuff.

Create a pager
--------------

[](#create-a-pager)

To paginate something:

```
$pager = new Pager(new ArrayAdapter($array));
```

Pager object
------------

[](#pager-object)

```
// Change position
$pager->setOffset(30);
$pager->setLimit(10);
$pager->setPerPage(20);
$pager->setPage(3);

// Inspect
$pager->getPageCount(); // can be zero
$pager->getPage();
$pager->getPerPage();
$pager->getOffset();
$pager->isFirstPage();
$pager->isLastPage();

foreach ($pager as $element) {
    echo $element;
}
```

Create your own adapter
-----------------------

[](#create-your-own-adapter)

If you want to paginate something, just create an adapter for it:

```
interface AdapterInterface
{
    public function get($offset, $limit);
    public function count();
}
```

Adapters
--------

[](#adapters)

```
// Paginate an array
$array = range(1, 1000);
$pager = new Pager(new ArrayAdapter($array));

// Paginate a git log
$log = $repository->getLog(); // see gitonomy/gitlib
$pager = new Pager(new GitlibLogAdapter($log));
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4678d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c6be58ec4620ddbcc6f95bf7353365dc7ff796c004c70369333aee6125eb309?d=identicon)[alexandresalome](/maintainers/alexandresalome)

---

Top Contributors

[![mickaelandrieu](https://avatars.githubusercontent.com/u/1247388?v=4)](https://github.com/mickaelandrieu "mickaelandrieu (2 commits)")

### Embed Badge

![Health badge](/badges/alexandresalome-pagination/health.svg)

```
[![Health](https://phpackages.com/badges/alexandresalome-pagination/health.svg)](https://phpackages.com/packages/alexandresalome-pagination)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
