开发者

CGridView pagination format

开发者 https://www.devze.com 2023-04-12 00:02 出处:网络
i like to get the pagination in the CGridView in this format normal structure: << < 1 2 3 4 5 6 7 8 9 > >>开发者_StackOverflow中文版

i like to get the pagination in the CGridView in this format

is there any solution for this. please help me.


Simple changing CLinkPager

in your config should be a strings:

'import'=>array(
    'application.components.*',
),

Create a file ./protected/components/LinkPager.php

<?php 
class LinkPager extends CLinkPager {
    public $maxButtonCount=3;
}

Then when you use CGridView in your code:

$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$dataProvider,
    'pager'=>'LinkPager',
));

By steps above, you creating a new pager class, which is used by CGridView for rendering pager section.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号