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

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

flatphp/pagination
==================

light pagination component

v1.0.0(6y ago)18MITPHPPHP &gt;=5.5

Since Feb 12Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

pagination
==========

[](#pagination)

light pagination component
简单分页组件

Install
=======

[](#install)

```
composer require flatphp/pagination

```

Usage
=====

[](#usage)

```
use Flatphp\Pagination\Paginator;

$page = 16;
$p = new Paginator(1506, $page);
$p->getNext();
// ...

// or specify page_size or specify page style, default sliding，others: all, elastic, jumping
// 配置每页数量，以及分页样式
$p = new Paginator(1506, $page, ['page_size' => 30, 'style' => 'jumping']);
$a = $p->toArray();
print_r($a);
```

Style
=====

[](#style)

stylenotesliding平滑，当前页在中间all全部宽度elastic弹性，当前页在中间，双倍宽度jumping跳跃，整个宽度到下一批宽度Methods
=======

[](#methods)

methodnotesetPageRange($page\_range)设置分页范围宽度setStyle($style)设置类型toArray()数组getRange()获取宽度大小getTotal()获取总数量getPageCount()获取总页数getPageSize()获取每页数量getPage()获取当前页getPrev()获取上一页getNext()获取下一页getPageRange()获取当前宽度范围hasPrev()是否有上一页hasNext()是否有下一页#### toArray

[](#toarray)

```
Array
(
    [page] => 16
    [page_size] => 20
    [total] => 1506
    [page_count] => 76
    [page_range] => 10
    [has_prev] => 1
    [has_next] => 1
    [prev] => 15
    [next] => 17
    [range] => Array
        (
            [0] => 11
            [1] => 12
            [2] => 13
            [3] => 14
            [4] => 15
            [5] => 16
            [6] => 17
            [7] => 18
            [8] => 19
            [9] => 20
        )

)

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

2287d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3e4d193838370dbe5119947cb84acd917f9e7dd4baf5ed9d0dbc88f26310fa5?d=identicon)[fredyang](/maintainers/fredyang)

---

Top Contributors

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

---

Tags

pagepagination

### Embed Badge

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

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

###  Alternatives

[beberlei/porpaginas

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

163612.6k11](/packages/beberlei-porpaginas)[babdev/pagerfanta-bundle

Bundle integrating Pagerfanta with Symfony

20817.8M65](/packages/babdev-pagerfanta-bundle)[kop/yii2-scroll-pager

Infinite AJAX scrolling for Yii2 ListView widget

180706.5k10](/packages/kop-yii2-scroll-pager)[usmanhalalit/strana

Pagination library for PHP, framework agnostic, with built-in adapters for Doctrine, Eloquent, Pixie and PHP Array.

947.4k3](/packages/usmanhalalit-strana)[georgringer/numbered-pagination

Improved pagination for TYPO3

281.3M13](/packages/georgringer-numbered-pagination)[log1x/pagi

A better WordPress pagination.

59105.4k](/packages/log1x-pagi)

PHPackages © 2026

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