PHPackages                             alexkratky/paginationx - 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. [Database &amp; ORM](/categories/database)
4. /
5. alexkratky/paginationx

ActiveLibrary[Database &amp; ORM](/categories/database)

alexkratky/paginationx
======================

Class to split data into several pages.

v1.0.0(6y ago)012MITPHPPHP &gt;=7.0

Since Sep 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/AlexKratky/PaginationX)[ Packagist](https://packagist.org/packages/alexkratky/paginationx)[ Docs](https://panx.eu/)[ RSS](/packages/alexkratky-paginationx/feed)WikiDiscussions master Synced 3d ago

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

Pagination
==========

[](#pagination)

Pagination is class that splits the data to segments and browse between these segments. Before usage SQL pagination, need to setup DB connection (AlexKratky\\db::connect()).

### Installation

[](#installation)

`composer require alexkratky/paginationx`

### The basic usage:

[](#the-basic-usage)

```
require 'vendor/autoload.php';
use AlexKratky\Pagination;

//example data
$data = array(0,1,2,3,4,5,6,7,8,9);
//enter data and how many elements are on page (3). By default 10.
$pagination = new Pagination($data, 3);
$d = $pagination->getData(); // [0,1,2]
$pagination->currentPage(); // 1
$pagination->totalPages(); // 4 (floor(10/3)+1)
$pagination->previousPage(); // false; because the first page is the lowest one
$pagination->nextPage(); // 2
```

The current page is set by AlexKratky\\Route::getValue("{PAGE}"); so just use in your routes {PAGE} parameter. Or it could be done by get parameter ?page= ($\_GET\["page"\]).

InfinityScrolling
-----------------

[](#infinityscrolling)

The InfinityScrolling is script, that will automatically load next page using AJAX when the user hits the bottom of page. Everything you need to do is calling this static method Pagination::infinityScroll() inside the DOM element, where the data will be loaded. Also, for this you need route CURRENT\_URI\_WHERE\_IS\_INFINITY\_SCROLL\_USED/load/{PAGE} which will serve the data.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~121 days

Total

3

Last Release

2239d ago

Major Versions

v0.2.0 → v1.0.02020-05-14

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33813757?v=4)[Alex Krátký](/maintainers/AlexKratky)[@AlexKratky](https://github.com/AlexKratky)

---

Top Contributors

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

---

Tags

phpdatasqlpaginationfilesplit

### Embed Badge

![Health badge](/badges/alexkratky-paginationx/health.svg)

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

###  Alternatives

[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k23.1k](/packages/clouddueling-mysqldump-php)[atlas/cli

Command-line interface for Atlas.

14127.7k10](/packages/atlas-cli)[friedolinfoerder/wp-activerecord

An ActiveRecord implementation for WordPress

237.6k](/packages/friedolinfoerder-wp-activerecord)[mammothphp/woollym

WoollyM: PHP Data Analysis Library

111.6k](/packages/mammothphp-woollym)

PHPackages © 2026

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