PHPackages                             dotzero/ypaginator - 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. dotzero/ypaginator

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

dotzero/ypaginator
==================

A lightweight PHP paginator without a database dependency, for generating pagination controls in the style of Yandex

0.7(10y ago)4892MITPHPPHP &gt;=5.3.0

Since Apr 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zero-archive/ypaginator-php)[ Packagist](https://packagist.org/packages/dotzero/ypaginator)[ RSS](/packages/dotzero-ypaginator/feed)WikiDiscussions master Synced 4w ago

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

PHP YPaginator
==============

[](#php-ypaginator)

[![Build Status](https://camo.githubusercontent.com/413ce6dbc0ceb6f991e217b035ecfc0418f7043ff8dfade03c7bb422f4ce1e4f/68747470733a2f2f7472617669732d63692e6f72672f646f747a65726f2f79706167696e61746f722d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dotzero/ypaginator-php)[![Latest Stable Version](https://camo.githubusercontent.com/d499d8830bb36cb03d885bae651fd00722e63901fa6a13460ca1fb94850feac3/68747470733a2f2f706f7365722e707567782e6f72672f646f747a65726f2f79706167696e61746f722f76657273696f6e)](https://packagist.org/packages/dotzero/ypaginator)[![License](https://camo.githubusercontent.com/ba3106e807e293124df48ed6136f8aef27631c3762d88158ae2e1e2439f8e148/68747470733a2f2f706f7365722e707567782e6f72672f646f747a65726f2f79706167696e61746f722f6c6963656e7365)](https://packagist.org/packages/dotzero/ypaginator)

A lightweight PHP paginator without a database dependency, for generating pagination controls in the style of Yandex.

Features
--------

[](#features)

- The `first` and `last` page links are shown
- The `current` and `neighbours` page links are shown
- Rest of links are replaced by ellipses

How it looks like:
------------------

[](#how-it-looks-like)

```
>
|1| ... |5||6||7| ... |100|

```

Usage
-----

[](#usage)

```
$total = 100; // Total items
$perpage = 10; // Items per page
$current = 5; // Current page
$neighbours = 2; // Neighbours links beside current page

$y = new \dotzero\YPaginator($total, $perpage, $current);

$paginator = $y
    ->setNeighbours($neighbours)
    ->setUrlMask('#num#')
    ->setUrlTemplate('/foo/page/#num#')
    ->getPaginator();

print_r($paginator);
```

Output looks like:

```
[
    "prev" => ["name" => 4,"url" => "/foo/page/4","current" => false], // Previous
    "pages" => [
        ["name" => 1,"url" => "/foo/page/1","current" => false], // First
        ["name" => "...","url" => "/foo/page/2","current" => false],
        ["name" => 3,"url" => "/foo/page/3","current" => false], // Neighbour
        ["name" => 4,"url" => "/foo/page/4","current" => false], // Neighbour
        ["name" => 5,"url" => "/foo/page/5","current" => true],  // Current
        ["name" => 6,"url" => "/foo/page/6","current" => false], // Neighbour
        ["name" => 7,"url" => "/foo/page/7","current" => false], // Neighbour
        ["name" => "...","url" => "/foo/page/8","current" => false],
        ["name" => 10,"url" => "/foo/page/10","current" => false] // Last
    ],
    "next" => ["name" => 6,"url" => "/foo/page/6","current" => false] // Next
];
```

Install
-------

[](#install)

### Via composer:

[](#via-composer)

```
$ composer require dotzero/ypaginator
```

### Without composer

[](#without-composer)

Clone the project using:

```
$ git clone https://github.com/dotzero/ypaginator-php
```

and include the source files with:

```
require_once("ypaginator-php/src/YPaginator.php");
```

Test
----

[](#test)

First install the dependencies, and after you can run:

```
$ vendor/bin/phpunit
```

License
-------

[](#license)

Licensed under the MIT license:

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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

3730d ago

### Community

Maintainers

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

---

Top Contributors

[![dotzero](https://avatars.githubusercontent.com/u/265633?v=4)](https://github.com/dotzero "dotzero (14 commits)")[![Rpsl](https://avatars.githubusercontent.com/u/265634?v=4)](https://github.com/Rpsl "Rpsl (1 commits)")

---

Tags

pagerpaginationpaginatorphppagerpaginatorpagination

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dotzero-ypaginator/health.svg)

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

###  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.3M22](/packages/jasongrimes-paginator)[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)[sivka/paginator

bootstrap-4 fork of jasongrimes/php-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.

141.4k](/packages/sivka-paginator)

PHPackages © 2026

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