Alphapager demo

Showing 1-20 of 51 items.
#Last NameFirst NameBornDied
1BacallLauren1924/09/162014/08/12
2BachJohann Sebastian1685/03/211750/07/28
3BaconFrancis1909/10/281992/04/28
4BakerJosephine1906/06/031975/04/12
5BardotBrigitte1934/09/28
6BarkinEllen1954/04/16
7BarrettSyd1946/01/062006/07/07
8BasieCount1904/08/211984/04/26
9BatailleGeorges1897/09/101962/07/10
10BauschPina1940/07/272009/06/30
11BeauvoirSimone de1908/01/091986/04/14
12BecketSamuel1906/04/131989/12/22
13BeefheartCaptain1941/01/152010/12/17
14BelmondoJean-Paul1933/04/09
15BergmanIngmar1918/07/142007/07/30
16BerlageHendrik Petrus1856/02/211934/08/12
17BerryChuck1926/10/182017/03/18
18BertolucciBernardo1940/03/162018/11/26
19BeuysJoseph1921/05/121986/01/23
20Björk1965/11/21

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.