Alphapager demo

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

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.