CPagination custom first page size

How to use custom pageSize in first page?

example:

  1. page: 20

2-…:10

Anyone?

Are you talking abou this

http://www.yiiframework.com/forum/index.php/topic/8994-dropdown-for-pagesize-in-cgridview/

http://www.ramirezcobos.com/2010/11/30/custom-page-size-for-cgridview/

http://www.yiiframework.com/extension/pagesize

Here’s a shot in the dark: turn off ajax, pass pagesize as parameter to the search function in the model and use $model->search($pagesize), setting $pagesize depending on the page you are at.

Hmm. I dont understand this.

My idea:


if(isset($_GET['page'])) $pages->setPageSize(2);

$this->widget('CLinkPager', array(

    'pages' => $pages,

    'prevPageLabel'=> Yii::t('layout','Előző'),

    'nextPageLabel'=>Yii::t('layout','Következő'),

    'maxButtonCount'=>5,

    'header'=>'',

    'id'=>'lapozo',

)); 

This show the pages correct, but the items is not good. :(

Or in the controller:


                if(isset($_GET['page'])) {

                    $pages->pageSize = 2;

                } else {

                    $pages->pageSize=$count;

                }

Dont work this. :(

I think the solution is analising the core /yii/framework/web/CPagination.php source and extending the class:

Modify methods:

getCurrentPage

getPageCount

setFirstPageSize($value)

and create a new private var:

private $_firstPageSize=null

After extend CLinkPager

Is it good idea (or not)?