Alphapager demo

Showing 1-18 of 18 items.
#Last NameFirst NameBornDied
1EastwoodClint1930/05/31
2EcoUmberto1932/01/052016/02/19
3EdisonThomas Alva1847/02/111931/10/18
4EinsteinAlbert1879/03/141955/04/18
5ElliotCass1941/09/191974/07/29
6EllisBret Easton1964/03/07
7EllroyJames1948/03/04
8EmersonKeith1944/11/022016/03/11
9EmmanuelTommy1955/05/31
10EnoBrian1948/05/15
11EnzensbergerHans Magnus1929/11/11
12ErasmusDesiderius1466/10/181536/07/02
13EscherM.C.1898/06/171972/03/27
14EulerLeonhard1707/04/151783/09/18
15EustacheJean1938/03/171981/11/04
16EuweMax1901/05/201981/11/27
17EverlyDon1937/02/012021/08/21
18EverlyPhil1939/01/192014/01/03

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.