Alphapager demo

Showing 1-20 of 54 items.
#Last NameFirst NameBornDied
1ByrneDavid1952/05/14
2BushKate1958/07/30
3BurroughsWilliam S.1914/02/051997/08/02
4BurdonEric1941/05/01
5BuñuelLuis1900/02/221983/07/26
6BukowskiCharles1920/08/161994/03/09
7BugattiEttore1881/09/151947/08/21
8BrunaDick1927/08/232017/02/16
9BrubeckDave1920/12/062012/12/05
10BrownArthur1942/06/24
11BrownJames1933/05/032006/12/25
12BrouwerL.E.J.1881/02/271966/12/02
13BroodHerman1946/11/052001/07/11
14BreukerWillem1944/11/042010/07/23
15BrelJacques1929/04/081978/10/09
16BreitnerGeorge Hendrik1857/09/121923/06/05
17BrechtBertolt1898/02/101956/08/14
18BrandoMarlon1924/04/032004/07/01
19BrandauerKlaus Maria1943/06/22
20BraccoLorraine1954/10/02

Yii2 Alphapager lets you do alphabetic paging in the Yii framework 2.0. On this page it is shown in it's default operation, 'out of the box'.

The relevant code involved is something like this:

<?php

use sjaakp\alphapager\ActiveDataProvider;
use sjaakp\alphapager\AlphaPager;

$query = Person::find()->orderBy('last_name, first_name');

$dataProvider = new ActiveDataProvider([
    'query' => $query,
    'alphaAttribute' => 'last_name',
]);
?>

<?= AlphaPager::widget([
    'dataProvider' => $dataProvider,
]) ?>

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],

        'last_name:ntext',
        'first_name:ntext',
        'born:date',
        'died:date',
    ],
]); ?>

A slightly more advanced example is here.