You need to set the pager
CListView
property. By default, this is CLinkPager
; you do not need to change this (this component covers your needs), but you need to configure it:
$this->widget('zii.widgets.CListView', array( 'dataProvider' => $categoryProjects, 'itemView' => '_itemDetailsView', 'ajaxUpdate' => false, 'pager' => array( 'class' => 'CLinkPager', 'firstPageLabel' => '<<', 'prevPageLabel' => '<', 'nextPageLabel' => '>', 'lastPageLabel' => '>>', ), ));
Update: If you want to “bake” the aforementioned custom configuration for all kinds of lists in your application, you need to create a new CustomListView
component obtained from CListView
. So you need this class:
Yii::import('zii.widgets.CListView'); class CustomListView extends CListView { public function init() { parent::init(); $this->pager = array( 'class' => 'CLinkPager', 'firstPageLabel' => '<<', 'prevPageLabel' => '<', 'nextPageLabel' => '>', 'lastPageLabel' => '>>', ); } }
After that, you can simply use CustomListView
as a list widget instead of zii.widgets.CListView
.
Jon
source share