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

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

anekdotes/pagination
====================

Utility to generate an intelligent ``range`` of links based on the current page and total pages.

2.0.0(4y ago)0611MITPHPPHP &gt;=7.4.0CI failing

Since Jul 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/anekdotes/pagination)[ Packagist](https://packagist.org/packages/anekdotes/pagination)[ RSS](/packages/anekdotes-pagination/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Anekdotes Pagination
====================

[](#anekdotes-pagination)

[![Latest Stable Version](https://camo.githubusercontent.com/d5aaff875bd2a26efe5f4c9cfac471731b8d080b3dc52e97f47fef03131f9648/68747470733a2f2f706f7365722e707567782e6f72672f616e656b646f7465732f706167696e6174696f6e2f762f737461626c65)](https://packagist.org/packages/anekdotes/pagination)[![Build Status](https://camo.githubusercontent.com/1d73411ad721e6020dd24547d35260076ea7aa8d7c9c4a13c175f25fe0249749/68747470733a2f2f7472617669732d63692e6f72672f616e656b646f7465732f706167696e6174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/anekdotes/pagination)[![StyleCI](https://camo.githubusercontent.com/d6c39a696e1495b1331ad647216a87266465e73070f5410edf0f4c1f0bca237a/68747470733a2f2f7374796c6563692e696f2f7265706f732f36323634373439392f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/62647499)[![License](https://camo.githubusercontent.com/77efc1bc880c7a47cdcb0b3d49b8c72248c54b2c506945a33b18505ddd33ddcc/68747470733a2f2f706f7365722e707567782e6f72672f616e656b646f7465732f706167696e6174696f6e2f6c6963656e7365)](https://packagist.org/packages/anekdotes/pagination)[![Total Downloads](https://camo.githubusercontent.com/1e05cd1046c5af7ef66bd0f4d27de46d66838e6b61c65fb68247a4367ece895e/68747470733a2f2f706f7365722e707567782e6f72672f616e656b646f7465732f706167696e6174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/anekdotes/pagination)[![Codacy Badge](https://camo.githubusercontent.com/3e7793a725dc4d70f5a695081466b6ac671ca4ec6df1e62bb8f2f2f6c262dd62/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3530313334666562636566653463633738646166303763613435393639373238)](https://www.codacy.com/app/Grasseh/pagination?utm_source=github.com&utm_medium=referral&utm_content=anekdotes/pagination&utm_campaign=Badge_Grade)

Utility to generate an intelligent "range" of links based on the current page and total pages.

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

[](#installation)

Install via composer into your project:

```
composer require anekdotes/pagination

```

Basic Usage
-----------

[](#basic-usage)

Instantiate the class and use the pager method with a few parameters.

- $pages: total number of pages
- $current: current page
- $length (optional): how many page to display

```
use Anekdotes\Pagination\Pagination;

$pagination = new Pagination();
var_dump($pagination->pager(10, 1));
/*
array(6) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
  [3]=>
  int(4)
  [4]=>
  int(5)
  [5]=>
  int(6)
}
*/
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% 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 ~651 days

Total

4

Last Release

1678d ago

Major Versions

1.0.2 → 2.0.02021-11-24

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

2.0.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17788771?v=4)[Anekdotes](/maintainers/anekdotes)[@anekdotes](https://github.com/anekdotes)

---

Top Contributors

[![franatieu](https://avatars.githubusercontent.com/u/4522233?v=4)](https://github.com/franatieu "franatieu (10 commits)")[![Grasseh](https://avatars.githubusercontent.com/u/2159610?v=4)](https://github.com/Grasseh "Grasseh (6 commits)")[![richerlariviere](https://avatars.githubusercontent.com/u/5884148?v=4)](https://github.com/richerlariviere "richerlariviere (1 commits)")

---

Tags

pagepagerpagination

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[jasongrimes/paginator

A lightweight PHP paginator, for generating pagination controls in the style of Stack Overflow and Flickr. The 'first' and 'last' page links are shown inline as page numbers, and excess page numbers are replaced by ellipses.

3741.3M21](/packages/jasongrimes-paginator)[aplus/pagination

Aplus Framework Pagination Library

2121.6M3](/packages/aplus-pagination)[kop/yii2-scroll-pager

Infinite AJAX scrolling for Yii2 ListView widget

178724.3k10](/packages/kop-yii2-scroll-pager)[beberlei/porpaginas

Library that generically solves several pagination issues with DAO/repository abstractions.

163632.5k13](/packages/beberlei-porpaginas)[ashleydawson/simple-pagination

Simple, lightweight and universal service that implements pagination on collections of things

18162.2k2](/packages/ashleydawson-simple-pagination)[ttskch/paginator-bundle

The most thin, simple and customizable paginator bundle for Symfony

1114.3k](/packages/ttskch-paginator-bundle)

PHPackages © 2026

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