PHPackages                             sjaakp/yii2-alphapager - 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. sjaakp/yii2-alphapager

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sjaakp/yii2-alphapager
======================

Page data on initial character in Yii2.

1.0.4(7y ago)184.4k6[3 issues](https://github.com/sjaakp/yii2-alphapager/issues)MITPHP

Since Jun 17Pushed 1y ago5 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Yii2 Alphapager
===============

[](#yii2-alphapager)

[![Latest Stable Version](https://camo.githubusercontent.com/069e7350253122cbe29dbc950b0a629bf5530a0ff9533ff04d40c49698bc732b/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d616c70686170616765722f762f737461626c65)](https://packagist.org/packages/sjaakp/yii2-alphapager)[![Total Downloads](https://camo.githubusercontent.com/cd12837a94726c3db87a7625064de43deddca549fb0dc9dc9303ca344df0a75e/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d616c70686170616765722f646f776e6c6f616473)](https://packagist.org/packages/sjaakp/yii2-alphapager)[![License](https://camo.githubusercontent.com/ee9f99092f58bb1036f1b7efe666b16fccee69e95ff5a518366a29d012ad68f9/68747470733a2f2f706f7365722e707567782e6f72672f736a61616b702f796969322d616c70686170616765722f6c6963656e7365)](https://packagist.org/packages/sjaakp/yii2-alphapager)

**Yii2 Alphapager** performs alphabetic paging with for instance `GridView`s or `ListView`s.

Just use `sjaakp\alphapager\ActiveDataProvider` in stead of your normal `yii\dataActiveDataProvider`, and put an `AlphaPager` widget in front of your `GridView`, and you're running.

Likewise with `sjaakp\alphapager\ArrayDataProvider`.

Alpha paging is compatible with normal pagination. You can use them together.

A demonstration of **Yii2 Aphapager** is [here](http://www.sjaakpriester.nl/software/alphapager).

#### Important notice

[](#important-notice)

**Yii2 Alphapager's ActiveDataProvider is only proven to work with MySQL and MariaDB databases. It should also work with SQLite and Cubrid, but this is not tested.**

In contrast to the Yii philosophy, **Yii2 Alphapager** is not transparent to the database, as I'm sorry to say. Presumably, `ActiveDataProvider` can be made to work with Oracle, Postgres, and MSSQL as well. See the comments near `$regex` in `ActiveDataProvider.php` for details. If you can provide more information on using **Yii2 Alphapager** with other databases, I'd be glad to hear it.

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

[](#installation)

The preferred way to install **Yii2 Alphapager** is through [Composer](https://getcomposer.org/). Either add the following to the require section of your `composer.json` file:

`"sjaakp/yii2-alphapager": "*"`

Or run:

`composer require sjaakp/yii2-alphapager "*"`

You can manually install **Yii2 Alphapager** by [downloading the source in ZIP-format](https://github.com/sjaakp/yii2-alphapager/archive/master.zip).

Usage
-----

[](#usage)

Using **Yii2 Alphapager** is easy. A minimum usage scenario would look like the following. In `PersonController.php` we would have something like:

```

```

Classes
-------

[](#classes)

### ActiveDataProvider and ActiveArrayProvider

[](#activedataprovider-and-activearrayprovider)

These are extensions from their Yii-counterparts in `yii\data`, and can be used in the same way. It is important to set attribute `$alphaAttribute`.

#### $alphaAttribute

[](#alphaattribute)

Set this to the name of the attribute which is used to define the pages. Must be set.

#### $alphaDigits

[](#alphadigits)

Setting for the way attribute values starting with a digit are handled. Can have the following values:

- `false`: no special handling; digits are treated just like any other non-alphabetic symbol (default)
- `'full'`: separate pages for each digit
- `'compact'`: one page for all digits
- `array` of characters: alpha pager doesn't display alphabetic characters, but uses the characters in this array; useful for non-western alphabets

#### $alphaPages

[](#alphapages)

Settings to modify alpha pagers operation. For normal use, this can remain the default value of `[]` (empty array). For more information, see the `_AlphaTrait.php` source.

#### $alphaDefault

[](#alphadefault)

Default page value; this page opens when no explicit page is given. Default value: `'A'`.

#### $alphaParam

[](#alphaparam)

The alphapager HTML parameter name. Default value: `'alpha'`. Might be changed if there is a conflict with other functionality.

---

### AlphaPager

[](#alphapager)

This is the widget that renders the actual alphapager. The attribute `$dataProvider` must be set.

#### $dataProvider

[](#dataprovider)

The **Yii2 Alphapager** `ActiveDataProvider` or `ArrayDataProvider` that this pager is associated with. Must be set.

#### $preButtons

[](#prebuttons)

`array` Page values of buttons which should appear left of the alphabetical buttons. Set this to `[]` if you don't want an '*all*' button. Default: `[ 'all' ]`.

#### $postButtons

[](#postbuttons)

`array` Page values of buttons which should appear right of the alphabetical buttons. Set this to `[]` if you don't want an '*\#*' (non-alphabetic) button. Default: `[ 'symbol' ]`.

#### $lowerCase

[](#lowercase)

`boolean` Whether the alphabetic buttons are rendered in lower case. Default: `false`.

#### $options

[](#options)

`array` HTML options for the alphapager container tag. Default: `[ 'class' => 'pagination' ]`, compatible with Bootstrap.

#### $buttonOptions

[](#buttonoptions)

`array` HTML options for the alphapager buttons. Default: `[ 'class' => 'page-item' ]`, compatible with Bootstrap 4.

#### $linkOptions

[](#linkoptions)

`array` HTML options for the alphapager links. Default: `[ 'class' => 'page-link' ]`, compatible with Bootstrap 4.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~468 days

Total

4

Last Release

2576d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/156f636aceedc73021a2bfafb5433271c2c55d6cf4bce06b12902c85b4b491f1?d=identicon)[sjaakp](/maintainers/sjaakp)

---

Top Contributors

[![sjaakp](https://avatars.githubusercontent.com/u/5585878?v=4)](https://github.com/sjaakp "sjaakp (16 commits)")[![chuprik](https://avatars.githubusercontent.com/u/802946?v=4)](https://github.com/chuprik "chuprik (2 commits)")

---

Tags

paginationpagingyii2extensionwidgetyiigridviewListView

### Embed Badge

![Health badge](/badges/sjaakp-yii2-alphapager/health.svg)

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

###  Alternatives

[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3030.6k](/packages/sjaakp-yii2-taggable)

PHPackages © 2026

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