Alphapager demo

Showing 41-48 of 48 items.
#Last NameFirst NameBornDied
41CrichtonMichael1942/10/232008/11/04
42CrickFrancis1916/06/082004/07/29
43CronkiteWalter1916/11/042009/07/17
44CrosbyDavid1941/08/142023/01/18
45CruijffJohan1947/04/252016/03/24
46CrumbRobert1943/08/30
47cummingse.e.1894/10/141962/09/03
48CurtisIan1956/07/151980/05/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.