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

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

anzubko/swf-paginator
=====================

Simplest framework pagination calculator

1.0.1(1y ago)01631GPL-3.0-or-laterPHPPHP &gt;=8.2

Since Mar 24Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (8)Used By (1)

Simplest framework pagination calculator
========================================

[](#simplest-framework-pagination-calculator)

This class intended for organization of page-by-page navigation on some data. Basically intended for construction of page-by-page navigation panels on websites.

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

[](#installation)

```
composer require anzubko/swf-paginator
```

Usage
-----

[](#usage)

```
use SWF\Paginator;

$p = new Paginator(
    $totalEntries,   // total number of entries (>=1)
    $entriesPerPage, // number of entries per page (>=1)
    $pagesPerSet,    // number of pages per set (>=1)
    $currentPage,    // current number of page
);

// Get some property directly
$p->totalEntries;

// Or by method call
$p->getTotalEntries();
```

Properties
----------

[](#properties)

### Slice params

[](#slice-params)

- $p-&gt;startOfSlice - start position of the slice (&gt;=0)
- $p-&gt;endOfSlice - end position of the slice (&gt;=0)
- $p-&gt;lengthOfSlice - length of the slice (&gt;=1)

### Statistics

[](#statistics)

- $p-&gt;totalEntries - total number of entries (&gt;=1) (copied from arguments)
- $p-&gt;entriesPerPage - number of entries per page (&gt;=1) (copied from arguments)
- $p-&gt;pagesPerSet - number of pages per set (&gt;=1) (copied from arguments)

### Pages control

[](#pages-control)

- $p-&gt;totalPages - total number of pages (&gt;=1)
- $p-&gt;currentPage - current number of page (&gt;=1) (copied from arguments and corrected)
- $p-&gt;prevPage - previous number of page (&gt;=1 or null)
- $p-&gt;nextPage - next number of page (&gt;=1 or null)

### Pages set control

[](#pages-set-control)

- $p-&gt;startOfSet - start position of current set (&gt;=1)
- $p-&gt;endOfSet - end position of current set (&gt;=1)
- $p-&gt;pageOfPrevSet - nearest page number of the previous set (&gt;=1 or null)
- $p-&gt;pageOfNextSet - nearest page number of the next set (&gt;=1 or null)
- $p-&gt;numbersOfSet - numbers of set (one or more numbers &gt;=1 in array)

Examples
--------

[](#examples)

### Simple

[](#simple)

```

                   /                   \
           $p->prevPage            $p->nextPage

```

### Advanced

[](#advanced)

```
                    $p->currentPage
                            |
        $p->prevPage        |           $p->nextPage
                \           |                /
               >>
        /               /           \                \
$p->pageOfPrevSet      /             \    $p->pageOfNextSet
                      /               \
            $p->startOfSet       $p->endOfSet
                     |                |
                    [ $p->numbersOfSet ]

```

### Statistics

[](#statistics-1)

```
                $p->totalPages
               /   $p->totalEntries
Total pages: 20   /
Total records: 200
Shown from 61 to 70 records
             \     \
              \     $p->startOfSlice + 1
               $p->endOfSlice + 1

```

Notes
-----

[](#notes)

- Most simple way to check, needs to show navigation panel or not, is checking $p-&gt;totalPages property. Needs only, if this property &gt; 1.
- $p-&gt;prevPage, $p-&gt;nextPage, $p-&gt;pageOfPrevSet and $p-&gt;pageOfNextSet properties must be checked for null before using.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Recently: every ~50 days

Total

7

Last Release

575d ago

Major Versions

0.0.5 → 1.0.02024-09-22

PHP version history (3 changes)0.0.1PHP ^8.2

0.0.3PHP ^8.3

0.0.5PHP &gt;=8.2

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/anzubko-swf-paginator/health.svg)

```
[![Health](https://phpackages.com/badges/anzubko-swf-paginator/health.svg)](https://phpackages.com/packages/anzubko-swf-paginator)
```

###  Alternatives

[bigwhoop/sentence-breaker

Sentence boundary disambiguation (SBD) - or sentence breaking - library written in PHP.

42132.3k](/packages/bigwhoop-sentence-breaker)[j0k3r/graby-site-config

Graby site config files

23365.8k3](/packages/j0k3r-graby-site-config)

PHPackages © 2026

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