Alphapager demo

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

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.