Alphapager demo

Showing 1-20 of 52 items.
#Last NameFirst NameBornDied
1SacharovAndrej1921/05/211989/12/14
2SacksOliver1933/07/092015/08/30
3SaganCarl1934/11/091996/12/20
4SaganFrançoise1935/06/212004/09/24
5Saint PhalleNiki de1930/10/292002/05/21
6SalterJames1925/06/102015/06/19
7SantanaCarlos1947/07/20
8SartreJean-Paul1905/06/211980/04/15
9SatieErik1866/05/171925/07/01
10SchieleEgon1890/06/121918/10/31
11SchneiderFlorian1947/04/072020/04/21
12SchneiderMaria1952/03/272011/02/03
13SchneiderRomy1938/09/231982/05/29
14SchulzCharles M.1922/11/262000/02/12
15SchwarzeneggerArnold1947/07/30
16SchwittersKurt1887/06/201948/01/08
17SchygullaHanna1943/12/25
18ScolaEttore1931/05/102016/01/19
19ScorceseMartin1942/11/17
20ScottRidley1937/11/30

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.