Alphapager demo

Showing 1-20 of 26 items.
#Last NameFirst NameBornDied
1LaanEberhard van der1955/06/282017/10/05
2LamarrHedy1914/11/092000/01/19
3LangFritz1890/12/051976/08/02
4LartigueJacques-Henri1894/06/131986/09/12
5LaurelStan1890/06/161965/02/23
6LeePeggy1920/05/262002/01/21
7LeeChristopher1922/05/272015/06/07
8LeeuwenhoekAntoni van1632/10/241723/08/26
9LehrerTom1928/04/09
10LennonJohn1940/10/091980/12/08
11LennoxAnnie1964/12/25
12LeoneSergio1929/01/031989/04/30
13LichtensteinRoy1923/10/271997/09/29
14LigetiGyörgy1923/05/282006/06/12
15LindemannTill1963/01/04
16LittellJonathan1967/10/10
17Little Richard1932/12/052020/05/09
18LollobrigidaGina1927/07/042023/01/16
19LordJon1941/06/092012/07/16
20LorenSophia1934/09/20

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.