This will likely be done in the Dataprovider pagination section or using CPagination.
The example given
function actionIndex(){
$criteria=new CDbCriteria();
$count=Article::model()->count($criteria);
$pages=new CPagination($count);
// results per page
$pages->pageSize=10;
$pages->applyLimit($criteria);
$models=Article::model()->findAll($criteria);
$this->render('index', array(
'models' => $models,
'pages' => $pages
));
}
Herer are the available properties
- currentPage
- itemCount
- limit
- offset
- pageCount
- pageSize
- pageVar
- params
- route
- validateCurrentPage
You can manually set the pageCount as 12 or check you have data for each month first before passing the correct value.
Your best bet is to then look at pageSize and see if there is anyway of passing this an array of values (ie a count for each month)
I have been unable to find anything more sufficient on this which is suprising as it seems fairly logical someone else has attempted this.
Maybe try posting on the Yii forum as I have had good success there previously.
Please see the following link for the above information.
http://www.yiiframework.com/doc/api/1.1/CPagination
Update
http://www.yiiframework.com/forum/index.php/topic/42936-solved-custom-page-size-for-cgridview-error/
http://www.ramirezcobos.com/2010/11/30/custom-page-size-for-cgridview/