How to customize Yii CGridView Pager?

2019-01-25 10:55发布

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

标签: php yii
3条回答
Root(大扎)
3楼-- · 2019-01-25 11:28

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,
));
查看更多
聊天终结者
4楼-- · 2019-01-25 11:33

Here's another approach which worked for me.

Displaying Yii's CLinkPager "First" and "Last" Buttons

If you have troubles, make sure to read the comments below the entry.

查看更多
登录 后发表回答