Alphapager demo

Showing 1-20 of 32 items.
#Last NameFirst NameBornDied
1PacinoAl1940/04/25
2PageBettie1923/04/222008/12/11
3PaikNam June1932/07/202006/01/29
4PalahniukChuck1962/02/21
5PalinMichael1943/05/05
6PalmaBrian De1940/09/11
7PalmerRobert1949/01/192003/09/26
8Panamarenko1940/12/052019/12/14
9ParkerTrey1969/10/19
10PasoliniPier Paolo1922/03/051973/04/08
11PaulAaron1979/08/27
12PaulLes1915/06/092009/08/13
13PaxmanJeremy1950/05/11
14PennebakerD.A.1925/07/152019/08/01
15PetersonOscar1925/08/152007/12/23
16PettyTom1950/10/202017/10/02
17PicassoPablo1881/10/251973/04/08
18PiccoliMichel1925/12/272020/05/12
19PinterHarold1930/10/102008/12/24
20PlanckMax1858/04/231947/10/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.