PHPackages                             iu-vpcm/rivet2-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. iu-vpcm/rivet2-pagination

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

iu-vpcm/rivet2-pagination
=========================

a lib to generate pagination of IU Rivet v2

v1.0(4y ago)09GPL-3.0-onlyPHP

Since May 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/zhuqiwen/iu-rivet-pagination-php)[ Packagist](https://packagist.org/packages/iu-vpcm/rivet2-pagination)[ RSS](/packages/iu-vpcm-rivet2-pagination/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Rivet Pagination
================

[](#rivet-pagination)

Well, the name tells everything. Hopefully this lib helps ease your life.

If more details of Pagination of Rivet V1 and V2 are needed:

1. [V1](https://rivet.iu.edu/components/navigation/pagination/)
2. [V2](https://v2.rivet.iu.edu/docs/components/pagination/)

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

[](#installation)

2 ways: using [Composer](https://getcomposer.org/), or direct `include`/`require`

### Composer

[](#composer)

run the following in your composer project's root folder, where the `composer.json` resides.

```
composer require iu-vpcm/rivet2-pagination
```

### Plain PHP include/require

[](#plain-php-includerequire)

Download the script, name it as you wish (for example `rivet_pagination.php`) and in your scripts:

```
require 'PATH-TO/rivet_pagination.php';
// or
// inlcude 'PATH-TO/rivet_pagination.php'
```

Usage
-----

[](#usage)

### Basic

[](#basic)

**NOTE:** If not specified in `$options['rivetVersion']`, the lib generates [Pagination of Rivet V2](https://v2.rivet.iu.edu/docs/components/pagination/).

The only required argument is the number of items that need to be paginated.

Other parameters such as the number of items per page, and the key in `$_GET` that indicates current page number, are listed below with their default values

```
/**
*   protected $pageKeyInGet = 'page';
*   protected $queryString = $_SERVER['QUERY_STRING];
*   protected $perPage = 9;
*   protected $paginationLength = 5;
*   protected $rivetVersion = 2;
 */
$totalNumItems = 100;
$pagination = new Pagination($totalNumItems);
echo $pagination->render();
```

### Advanced

[](#advanced)

#### V1 pagination

[](#v1-pagination)

[Pagination of Rivet V1](https://rivet.iu.edu/components/navigation/pagination/)

```
// not required
$v1Settings = [
    'position' => 'center', // or 'right'
    'size' => 'small'
];

$options = [
    'rivetVersion' => 'v1', // required if V1 pagination is desired
    'rivetV1Settings' => $v1Settings // it not set or empty, default style of V1 will be applied
];
$pagination = new \Edu\IU\VPCM\Rivet\Pagination(150, $options);
echo $pagination->render();
```

#### Set pagination length/width

[](#set-pagination-lengthwidth)

```
/**
*   default
*   protected $paginationLength = 5;
 */
$totalNumItems = 100;
$options = ['paginationLength' => 10]
$pagination = new Pagination($totalNumItems, $options);
echo $pagination->render();
```

#### Set the number of items to display per page

[](#set-the-number-of-items-to-display-per-page)

```
/**
*   default
*   protected $perPage = 9;
 */
$totalNumItems = 100;
$options = ['perPage' => 10]
$pagination = new Pagination($totalNumItems, $options);
echo $pagination->render();
```

#### Set which key in $\_GET indicates page number

[](#set-which-key-in-_get-indicates-page-number)

```
/**
*   default
*   protected $pageKeyInGet = 'page';
 */
$totalNumItems = 100;
$options = ['pageKeyInGet' => 'myPage']
$pagination = new Pagination($totalNumItems, $options);
echo $pagination->render();
```

#### If custom query string is needed

[](#if-custom-query-string-is-needed)

```
/**
*   default
*   protected $queryString = $_SERVER['QUERY_STRING];
 */
$totalNumItems = 100;
$options = ['queryString' => '?tom=jerry&mj=forever'] // the '?' can be omitted
$pagination = new Pagination($totalNumItems, $options);
echo $pagination->render();
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

1462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66307533c75b16d8f643ca832c6f7c01db15dab1ac7f03dcb3ef678c486c8cfa?d=identicon)[zhuqiwen](/maintainers/zhuqiwen)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/iu-vpcm-rivet2-pagination/health.svg)

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

###  Alternatives

[ramsey/devtools

A Composer plugin to aid PHP library and application development.

7134.7k26](/packages/ramsey-devtools)[jimbojsb/workman

PHP process forking &amp; daemonizing library

608.8k](/packages/jimbojsb-workman)

PHPackages © 2026

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