PHPackages                             justinvoelker/yii2-separatedpager - 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. justinvoelker/yii2-separatedpager

ActiveYii2-extension

justinvoelker/yii2-separatedpager
=================================

A Yii2 LinkPager that displays the first and last pages inline with other pages.

1.0.2(10y ago)2973.3k↓76.1%16[1 issues](https://github.com/justinvoelker/yii2-separatedpager/issues)2BSD-3-ClausePHP

Since Feb 21Pushed 4y ago3 watchersCompare

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

READMEChangelogDependencies (1)Versions (4)Used By (2)

Separated Pager for Yii2
========================

[](#separated-pager-for-yii2)

A Yii2 LinkPager that displays the first and last pages inline with other pages.

Rather than having dedicated "First" and "Last" buttons in your LinkPager, **Separated Pager** will show a standard set of page links but will also always include the first and last pages as the first and last page links. No more dedicated first/last buttons and no more guessing how many pages there are.

[![sample](https://cloud.githubusercontent.com/assets/2441889/6312491/6a89be10-b948-11e4-9ac8-bcd793664e1a.png)](https://cloud.githubusercontent.com/assets/2441889/6312491/6a89be10-b948-11e4-9ac8-bcd793664e1a.png)

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

[](#installation)

### Install the extension

[](#install-the-extension)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist justinvoelker/yii2-separatedpager "*"

```

or add

```
"justinvoelker/yii2-separatedpager": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Simply add the `pager` property to your GridView and reference this class

```
GridView::widget([
    'dataProvider' => $dataProvider,
    ...
    'pager' => [
        'class' => 'justinvoelker\separatedpager\LinkPager',
    ]
]);
```

Please note that specifying less than 7 pages won't produce useful results. Less than 7 pages of content is acceptable (will look like the standard LinkPager) but limiting the pager to something less than 7 pages will look and work poorly. Five pages and the pager is almost worthless. Less than 5 and it is worthless.

Available Options
-----------------

[](#available-options)

In addition to all of the standard [LinkPager](www.yiiframework.com/doc-2.0/yii-widgets-linkpager.html) properties, one new property has been added, `separator`, that specifies a string to be used to indicate that multiple pages are being omitted. The default separator is `...`.

Here is my preferred pager setup. A max of 7 pages, 'Previous' and 'Next' buttons spelled out that are hidden on extra-small screens.

```
    'pager' => [
        'class' => 'justinvoelker\separatedpager\CustomLinkPager',
        'maxButtonCount' => 7,
        'prevPageLabel' => 'Previous',
        'nextPageLabel' => 'Next',
        'prevPageCssClass' => 'prev hidden-xs',
        'nextPageCssClass' => 'next hidden-xs',
        'activePageAsLink' => false,
    ]
```

Keep in mind that setting css classes will overwrite the defaults rather than appending to them. If additional classes should be included (such as the 'hidden-xs' above) the original `prev` and `next` should be included as well (this is the same way the standard LinkPager functions).

Standard LinkPager functionality uses a link for the active page. By setting `activePageAsLink` to false the link can be replaced with a span that looks the same but cannot be clicked.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~49 days

Total

3

Last Release

4001d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/250c304267e68b69e45180f9863c1ff7578780afae46e118be7b3ff71de72a9b?d=identicon)[justinvoelker](/maintainers/justinvoelker)

---

Top Contributors

[![justinvoelker](https://avatars.githubusercontent.com/u/2441889?v=4)](https://github.com/justinvoelker "justinvoelker (6 commits)")[![IgorSalevan](https://avatars.githubusercontent.com/u/5684414?v=4)](https://github.com/IgorSalevan "IgorSalevan (2 commits)")[![enkr1](https://avatars.githubusercontent.com/u/64194467?v=4)](https://github.com/enkr1 "enkr1 (1 commits)")

---

Tags

paginationyii2linkpager

### Embed Badge

![Health badge](/badges/justinvoelker-yii2-separatedpager/health.svg)

```
[![Health](https://phpackages.com/badges/justinvoelker-yii2-separatedpager/health.svg)](https://phpackages.com/packages/justinvoelker-yii2-separatedpager)
```

###  Alternatives

[kop/yii2-scroll-pager

Infinite AJAX scrolling for Yii2 ListView widget

180706.5k10](/packages/kop-yii2-scroll-pager)[liyunfang/yii2-widget-linkpager

yii2 Widget for LinkPager

4734.2k4](/packages/liyunfang-yii2-widget-linkpager)[sjaakp/yii2-alphapager

Page data on initial character in Yii2.

184.4k](/packages/sjaakp-yii2-alphapager)

PHPackages © 2026

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