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

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

zozor/paginator
===============

Pagination system

v1.0.3(1y ago)05MITHTMLPHP ^8.3

Since Apr 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Zorglu/zzpaginator)[ Packagist](https://packagist.org/packages/zozor/paginator)[ RSS](/packages/zozor-paginator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (5)Used By (0)

ZZPaginator

[![license](https://camo.githubusercontent.com/b5928bb43e5efae07068e82d0dc36af6507355129a2fab55088104770908ac3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6f7a6f722f706167696e61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zozor/paginator)[![license](https://camo.githubusercontent.com/7eeff609008242f6433c3e1c5ac23af4baa5c7e818bbb6d2143f322e6c38c2b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6f7a6f722f706167696e61746f722e7376673f7374796c653d666c61742d737175617265266c6162656c3d646f776e6c6f616473)](https://packagist.org/packages/zozor/paginator)[![license](https://camo.githubusercontent.com/d2925ef1ce48cde907dabf44226148f10c8f88e81722245aa1c626e0e5f54625/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a6f7a6f722f706167696e61746f722e7376673f7374796c653d666c61742d737175617265266c6162656c3d6c6963656e7365)](https://github.com/Zorglu/zzpaginator/blob/main/LICENSE.md)[![license](https://camo.githubusercontent.com/25883a0787e0779e679e5e985cbf708b6a616372441373894c5545369e62385f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7a6f7a6f722f706167696e61746f722f7068702e7376673f6c6162656c3d706870267374796c653d666c61742d737175617265)](https://php.net/)
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#)

A simple paginator for PHP ^8.3 for use with javascript fetch. The HTML page without PHP, which will display rows extracted from a database, will make a request in JavaScript using `fetch()` to a PHP page that will return the retrieved rows along with pagination data.

The PHP page, which will fetch the rows from the database, can initialize the `zozor/paginator` class to create a pagination tool. All of this can be returned to JavaScript in JSON format.

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

[](#installation)

### Requirements

[](#requirements)

Paginator requires [PHP](https://php.net/) 8.3 or higher.

### Using Composer

[](#using-composer)

The recommended way to install Paginator is with [Composer](https://getcomposer.org/), a dependency manager for PHP.

You should just add `zozor/paginator` to your project dependencies in `composer.json`. It is recommended to add them manually to `composer.json`

```
{
    "require": {
        "zozor/paginator": "^1.0"
    }
}
```

or

```
composer require zozor/paginator
```

### Manually Installation

[](#manually-installation)

Alternatively, you could download all files in the [`src`](https://github.com/Zorglu/zzpaginator/tree/main/src) directory from GitHub and then manually include them in your script.

Example of Usage (file : get\_pagination.php)
---------------------------------------------

[](#example-of-usage-file--get_paginationphp)

```
