如何自定义 Yii CGridView Pager?

2022-01-04 00:00:00 php yii

如何自定义 Yii CGridView Pager 的位置、css、模板?

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

推荐答案

您可以通过 'pager' CGridView 属性进行自定义.示例:

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,
));

相关文章