Alphapager demo
Showing 1-20 of 611 items.
# | Last Name | First Name | Born | Died |
---|---|---|---|---|
1 | !Xobile | 1970/09/29 | — | |
2 | 007 | 1908/05/28 | 1964/08/12 | |
3 | 50 Cent | 1975/06/06 | — | |
4 | Adjani | Isabelle | 1955/06/27 | — |
5 | Adler | Charlie | 1957/02/20 | — |
6 | Albee | Edward | 1928/03/12 | 2016/09/16 |
7 | Aldrin | Buzz | 1930/01/20 | — |
8 | Ali | Muhammad | 1942/01/17 | 2016/06/03 |
9 | Allen | Woody | 1935/12/01 | — |
10 | Anderson | Gerry | 1929/04/14 | 2012/12/26 |
11 | Anderson | Laurie | 1947/06/05 | — |
12 | Andriessen | Louis | 1939/06/06 | 2021/07/01 |
13 | Antonioni | Michelangelo | 1912/09/29 | 2007/07/30 |
14 | Apollinaire | Guillaume | 1880/08/26 | 1918/11/09 |
15 | Appel | Karel | 1921/04/25 | 2006/05/03 |
16 | Aragon | Louis | 1897/10/03 | 1982/12/23 |
17 | Araki | Nobuyoshi | 1940/05/25 | — |
18 | Armstrong | Louis | 1901/08/04 | 1971/07/06 |
19 | Armstrong | Neil | 1930/08/05 | 2012/08/25 |
20 | Arp | Hans | 1887/09/16 | 1966/06/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.