Alphapager demo

Showing 21-40 of 40 items.
#Last NameFirst NameBornDied
21HitchcockAlfred1899/08/131980/04/28
22HitchensChristopher1949/04/132011/12/15
23HockneyDavid1937/07/09
24HoffmanDustin1937/08/08
25HoffmanPhilip Seymour1967/07/232014/02/02
26HofstadterDouglas1945/02/15
27HollandJools1958/01/24
28HoltSimeon ten1923/01/242012/11/25
29HookerJohn Lee1917/08/222001/06/21
30HopkinsAnthony1937/12/31
31HopperDennis1936/05/172010/05/29
32HopperEdward1882/07/221967/05/15
33HoudiniHarry1874/03/241926/10/31
34HouellebecqMichel1958/02/26
35HuntHelen1963/06/15
36HuppertIsabelle1953/03/16
37HütterRalf1946/08/20
38HuxleyAldous1894/07/261963/11/22
39HuygensChristiaan1629/04/141695/07/08
40HyndeChrissie1951/09/07

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.