Alphapager demo
Showing 21-40 of 611 items.
# | Last Name | First Name | Born | Died |
---|---|---|---|---|
21 | Asimow | Isaac | 1920/01/02 | 1992/04/06 |
22 | Attenborough | David | 1926/05/08 | — |
23 | Aznavour | Charles | 1924/05/22 | 2018/10/01 |
24 | Bacall | Lauren | 1924/09/16 | 2014/08/12 |
25 | Bach | Johann Sebastian | 1685/03/21 | 1750/07/28 |
26 | Bacon | Francis | 1909/10/28 | 1992/04/28 |
27 | Badalamenti | Angelo | 1937/03/22 | 2022/12/11 |
28 | Baker | Josephine | 1906/06/03 | 1975/04/12 |
29 | Bardot | Brigitte | 1934/09/28 | — |
30 | Bargeld | Blixa | 1959/01/12 | — |
31 | Barkin | Ellen | 1954/04/16 | — |
32 | Barrett | Syd | 1946/01/06 | 2006/07/07 |
33 | Basie | Count | 1904/08/21 | 1984/04/26 |
34 | Bataille | Georges | 1897/09/10 | 1962/07/10 |
35 | Bausch | Pina | 1940/07/27 | 2009/06/30 |
36 | Beauvoir | Simone de | 1908/01/09 | 1986/04/14 |
37 | Becket | Samuel | 1906/04/13 | 1989/12/22 |
38 | Beefheart | Captain | 1941/01/15 | 2010/12/17 |
39 | Belafonte | Harry | 1927/03/01 | 2023/04/25 |
40 | Belmondo | Jean-Paul | 1933/04/09 | 2021/09/06 |
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.