PHPackages                             ecommit/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. ecommit/paginator

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

ecommit/paginator
=================

Create a paginator.

v1.4.0(3mo ago)018.3k↑15%11MITPHPPHP ^8.1CI passing

Since May 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/e-commit/paginator)[ Packagist](https://packagist.org/packages/ecommit/paginator)[ RSS](/packages/ecommit-paginator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (1)

Paginator
=========

[](#paginator)

Create a paginator.

[![Tests](https://github.com/e-commit/paginator/workflows/Tests/badge.svg)](https://github.com/e-commit/paginator/workflows/Tests/badge.svg)

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

[](#installation)

To install paginator with Composer just run :

```
$ composer require ecommit/paginator
```

Usage
-----

[](#usage)

```
use Ecommit\Paginator\ArrayPaginator;

//Create a paginator
$paginator = new ArrayPaginator([
    //Options
    'page' => 1,
    'max_per_page' => 100,
    'data' => ['val1', 'val2', 'val3'],
    //Or with an ArrayIterator
    //'data' => new \ArrayIterator(['val1', 'val2', 'val3']),
]);

$totalPages = $paginator->getLastPage();
$countRows = \count($paginator);
foreach ($paginator as $result) {
    //...
}
```

### Available options

[](#available-options)

OptionTypeRequiredDefault valueDescription**page**IntegerNo1Current page**max\_per\_page**IntegerNo100Max elements per page**data**Array or ArrayIteratorYes- If `count` option is null : All data (of all pages)
- If `count` option is not null : Only the data to display on the current page

**count**Integer or nullNoNull*You can use this option when the data volume is too large.* If the value is not null :- It must equal the total number of results
- The `data` option must contain only the data to display on the current page

### Available methods

[](#available-methods)

See [API documentation](src/PaginatorInterface.php)

License
-------

[](#license)

This librairy is under the MIT license. See the complete license in *LICENSE* file.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~272 days

Recently: every ~283 days

Total

6

Last Release

91d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/73191162d97fffaa1a23d23326a7a77fbaa94ce41e49cf4ee6cbf0b9c9800c80?d=identicon)[e-commit](/maintainers/e-commit)

---

Top Contributors

[![hlecorche](https://avatars.githubusercontent.com/u/188749?v=4)](https://github.com/hlecorche "hlecorche (60 commits)")

---

Tags

arraypaginator

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ecommit-paginator/health.svg)

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

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[knplabs/knp-components

Knplabs component library

77343.6M46](/packages/knplabs-knp-components)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)

PHPackages © 2026

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