Alphapager demo
Showing 101-120 of 611 items.
# | Last Name | First Name | Born | Died |
---|---|---|---|---|
101 | Cocker | Joe | 1944/05/20 | 2014/12/22 |
102 | Coetzee | J.M. | 1940/02/09 | — |
103 | Cohen | Leonard | 1934/09/21 | 2016/11/07 |
104 | Cohn-Bendit | Daniel | 1945/04/04 | — |
105 | Coltrane | John | 1926/09/23 | 1967/07/17 |
106 | Connery | Sean | 1930/08/25 | 2020/10/31 |
107 | Conway | John | 1937/12/26 | 2020/04/11 |
108 | Cooder | Ry | 1947/03/15 | — |
109 | Copernicus | Nicolaus | 1473/02/10 | 1543/05/14 |
110 | Coppola | Francis Ford | 1939/04/07 | — |
111 | Corbusier | Le | 1887/10/06 | 1965/08/27 |
112 | Corea | Chick | 1941/06/12 | 2021/02/09 |
113 | Costello | Elvis | 1954/08/25 | — |
114 | Coupland | Douglas | 1961/12/30 | — |
115 | Coward | Noël | 1899/12/16 | 1973/03/26 |
116 | Coyne | Kevin | 1944/01/27 | 2004/12/02 |
117 | Cranston | Bryan | 1956/03/07 | — |
118 | Crichton | Michael | 1942/10/23 | 2008/11/04 |
119 | Crick | Francis | 1916/06/08 | 2004/07/29 |
120 | Cronkite | Walter | 1916/11/04 | 2009/07/17 |
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.