Alphapager demo

Showing 1-18 of 18 items.
#Last NameFirst NameBornDied
1AdjaniIsabelle1955/06/27
2AdlerCharlie1957/02/20
3AlbeeEdward1928/03/122016/09/16
4AldrinBuzz1930/01/20
5AliMuhammad1942/01/172016/06/03
6AllenWoody1935/12/01
7AndersonGerry1929/04/142012/12/26
8AndersonLaurie1947/06/05
9AntonioniMichelangelo1912/09/292007/07/30
10ApollinaireGuillaume1880/08/261918/11/09
11AppelKarel1921/04/252006/05/03
12AragonLouis1897/10/031982/12/23
13ArmstrongLouis1901/08/041971/07/06
14ArmstrongNeil1930/08/052012/08/25
15ArpHans1887/09/161966/06/07
16AsimowIsaac1920/01/021992/04/06
17AttenboroughDavid1926/05/08
18AznavourCharles1924/05/22

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.