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

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

tasofen/pagination
==================

Page navigation

v1.0.1(5y ago)014MITPHP

Since Nov 21Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

Install via [composer](https://getcomposer.org/)
------------------------------------------------

[](#install-via-composer)

```
composer require tasofen/pagination
```

Constructor options
-------------------

[](#constructor-options)

NameTypeDefaultDescriptionshowPagesNumber11Count number linksurlString'?page=%s'URLlistTagStringulWrap all linkslistClassStringpaginationClass for wrap tagitemWrapStringliWrap item linkitemClassStringpage-item waves-effectClass for wrap item taglinkClassStringpage-linkClass for linkactiveClassStringactiveActive classfirstBooleantrueShow link to first pagelastBooleantrueShow link to last pageprevBooleantrueShow link to prev pagenextBooleantrueShow link to next pageMethods
-------

[](#methods)

```
$pagination->getHtml($currentPate, $totalPage);
$pagination->getJSON($currentPate, $totalPage);
$pagination->getArray($currentPate, $totalPage);
```

Base usage
----------

[](#base-usage)

```
require 'vendor/autoload.php';
$pagination = new Tasofen\Pagination([
    'showPages' => 5
]);
echo $pagination->getHtml(7, 20); //currentPage, totalPage
```

### Result:

[](#result)

[![demo-image](https://github.com/tasofen/pagination/raw/master/demo/demo-1.png)](https://github.com/tasofen/pagination/raw/master/demo/demo-1.png)

```

    &lt;&lt;

    &lt;

    5

    6

    7

    8

    9

    &gt;

    &gt;&gt;

```

Example 1
---------

[](#example-1)

```
$pagination = new Tasofen\Pagination([
    'showPages' => 5
]);
for($i=1;$igetHtml($i, 10);
    echo '';
}
```

Result
------

[](#result-1)

[![demo-image](https://github.com/tasofen/pagination/raw/master/demo/demo-2.png)](https://github.com/tasofen/pagination/raw/master/demo/demo-2.png)

Example 2
---------

[](#example-2)

```
$pagination = new Tasofen\Pagination([
    'showPages' => 3
]);
$list = $pagination->getArray(7, 20); //currentPage, totalPage
print_r($list);
```

### Result

[](#result-2)

```
Array
(
    [0] => Array
        (
            [url] => ?page=1
            [text] => &lt;&lt;
            [active] => false
        )

    [1] => Array
        (
            [url] => ?page=6
            [text] => &lt;
            [active] => false
        )

    [2] => Array
        (
            [url] => ?page=6
            [text] => 6
            [active] => false
        )

    [3] => Array
        (
            [url] => ?page=7
            [text] => 7
            [active] => true
        )

    [4] => Array
        (
            [url] => ?page=8
            [text] => 8
            [active] => false
        )

    [5] => Array
        (
            [url] => ?page=8
            [text] => &gt;
            [active] => false
        )

    [6] => Array
        (
            [url] => ?page=20
            [text] => &gt;&gt;
            [active] => false
        )
)
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

1994d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67db5f6a47a3d06db794d1a16da32c2464847b74cf06a85073117fa809890b98?d=identicon)[tasofen](/maintainers/tasofen)

---

Tags

paginationbootstrapmaterializecss

### Embed Badge

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

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

###  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.8k283.4k1](/packages/wenzhixin-bootstrap-table)[aplus/pagination

Aplus Framework Pagination Library

2091.6M3](/packages/aplus-pagination)[babdev/pagerfanta-bundle

Bundle integrating Pagerfanta with Symfony

20817.8M65](/packages/babdev-pagerfanta-bundle)[romdim/yii2-bootstrap-material

Composer package for implementing FezVrasta's bootstrap material design in Yii2.

2010.9k3](/packages/romdim-yii2-bootstrap-material)[voodoophp/paginator

Paginator is a simple class that allows you to create pagination. It doesn't require any database connection. It is compatible with Twitter's Bootstrap Framework, by using the CSS class pagination that is also attached.

351.5k1](/packages/voodoophp-paginator)[bostondv/bootstrap-ninja-forms

Adds Bootstrap classes to Ninja Forms

222.2k](/packages/bostondv-bootstrap-ninja-forms)

PHPackages © 2026

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