Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize Yii CGridView Pager?

Tags:

php

yii

How to customize Yii CGridView Pager about its position, css, template?

like image 282
tq0fqeu Avatar asked May 25 '10 07:05

tq0fqeu


2 Answers

You can custumize via 'pager' CGridView properties. Example:

$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'My-grid',
    'dataProvider'=>$dataProvider,
    'pager'=>array(
        'header'         => '',
        'firstPageLabel' => '<<',
        'prevPageLabel'  => '<img src="images/pagination/left.png">',
        'nextPageLabel'  => '<img src="images/pagination/right.png">',
        'lastPageLabel'  => '&gt;&gt;',
    ),
    'template'=>'{pager}{items}{pager}',
    'columns'=>$arrayColumns,
));
like image 146
Davuz Avatar answered Oct 21 '22 13:10

Davuz


  1. http://www.yiiframework.com/doc/api/CBaseListView#pager-detail
  2. http://www.yiiframework.com/doc/api/CBaseListView#pagerCssClass-detail
  3. http://www.yiiframework.com/doc/api/CLinkPager
like image 24
Sam Dark Avatar answered Oct 21 '22 13:10

Sam Dark