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

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

slejnej/pagination-php
======================

A PHP pagination that accepts anything and tries to paginate it.

1.0.1(6y ago)03MITPHPPHP &gt;=7.2

Since Mar 25Pushed 6y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Pagination for PHP
==================

[](#pagination-for-php)

[![Build Status](https://camo.githubusercontent.com/1a5f1b5c1a14dd710ab939c62d773cc9b4bd00fdc9c535bdcd8bf69711662e11/68747470733a2f2f7472617669732d63692e6f72672f736c656a6e656a2f706167696e6174696f6e2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/slejnej/pagination-php)

Light weight pagination for PHP with full control over output and displaying of data. Emulates the Mobile view with replacing excess numbers with dot-dot-dot (ellipse).

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

[](#installation)

Install with composer:

```
composer require slejnej/pagination-php

```

Basic usage
-----------

[](#basic-usage)

Example with default values

```

             entries. Showing
            .

```

Available functions
-------------------

[](#available-functions)

functionactiongetItemsreturns items for selected page, or empty arraysetMaxPagesToShowSET number of page links in navigation (min. 3)getMaxPagesToShowreturns int number of links in navigationgetCurrentPagereturns int number of current pagesetItemsPerPageSET number of items per page (default: 10)getItemsPerPagereturns int number of items per pagegetTotalItemsreturns total number of items sent to paginategetNumPagesreturns int number of pagessetUrlPatternSET new navigation URL pattern (default: `(:num)`)getUrlPatternreturns current URL patterngetPageUrlreturns URL that is created from URL pattern and page numbergetNextPagereturns int number or null for next pagegetPrevPagereturns int number or null for previous pagegetNextUrlreturns URL or null for next pagegetPrevUrlreturns URL or null for previous pagegetNavigationreturns array structure for entire navigationgetNavigationHtmlreturns navigation HTMLgetCurrentPageFirstItemreturns sequential number of first item on selected pagegetCurrentPageLastItemreturns sequential number of last item on selected page

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~0 days

Total

2

Last Release

2290d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7508599?v=4)[Jernej Slejko](/maintainers/slejnej)[@slejnej](https://github.com/slejnej)

---

Top Contributors

[![slejnej](https://avatars.githubusercontent.com/u/7508599?v=4)](https://github.com/slejnej "slejnej (5 commits)")

---

Tags

pagination

### Embed Badge

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

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

###  Alternatives

[wenzhixin/bootstrap-table

An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)

11.8k287.3k1](/packages/wenzhixin-bootstrap-table)[babdev/pagerfanta-bundle

Bundle integrating Pagerfanta with Symfony

21019.3M93](/packages/babdev-pagerfanta-bundle)[webcreate/jquery-ias

Infinite Ajax Scroll: A jQuery plugin that turns your server-side pagination into an infinite scrolling one using AJAX

903736.3k3](/packages/webcreate-jquery-ias)[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.

4091.3M22](/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

181732.8k10](/packages/kop-yii2-scroll-pager)

PHPackages © 2026

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