Alphapager demo

Showing 1-20 of 53 items.
#Last NameFirst NameBornDied
1MaYo-Yo1955/10/07
2MacFarlaneSeth1973/10/26
3MacKayGeorge1992/03/13
4MacneePatrick1922/02/062015/06/25
5Madonna1959/08/16
6MailerNorman1923/01/312007/11/10
7MalevitsjKazimir1878/02/231935/05/15
8MalkovichJohn1953/12/09
9MandelaNelson1918/07/182013/12/05
10MandelbrotBenoît1924/11/202010/10/14
11MannThomas1875/06/061955/08/12
12ManzarekRay1939/02/122013/05/20
13MarleyBob1945/02/061981/05/11
14MárquezGabriel García1927/03/062014/04/17
15MartinDon1931/05/182000/01/06
16MartinGeorge1926/01/032016/03/08
17MarxGroucho1895/10/021977/08/18
18MastroianniMarcello1923/09/281996/12/19
19Mata Hari1876/08/071917/10/15
20MatisseHenri1869/12/311954/11/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.