How to customize Yii CGridView Pager?

前端 未结 3 1662
轻奢々
轻奢々 2020-12-17 22:09

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

相关标签:
3条回答
  • 2020-12-17 22:36
    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
    0 讨论(0)
  • 2020-12-17 22:42

    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.

    0 讨论(0)
  • 2020-12-17 22:56

    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,
    ));
    
    0 讨论(0)
提交回复
热议问题