0

I want to display data in a CGridView from a table that is has a date field. I'd like to use year ranges, constructed from the date, as labels for paging, in a format like 2010-11,2011-12, 2012-13 etc., where the years run from say July 1 through June 30. So the pager might look something like: << < 2010-11|2011-12|2013-13|2013-14 > >>

I guess I will also need to pass different criteria to the paging for each clicked label as well.

I have looked at subclassing CPager and/or CLinkPager but they don't seem to offer custom labels for the paging.

Seems like an obvious thing to do but searching the web and the Yii forums did not turn up a similar example.

Any hints on how to proceed would be much appreciated.

sdjuan
  • 709
  • 6
  • 15
  • 2
    Similar question, this might give you some hint: [How to customize Yii CGridView Pager?](http://stackoverflow.com/questions/2902723/how-to-customize-yii-cgridview-pager) or [Changing the Page Labels in Yii?](http://stackoverflow.com/questions/8436520/changing-the-page-labels-in-yii?rq=1) –  May 23 '13 at 06:54
  • Thanks. I already saw those and many more like them. Those only allow changing the first,previous,next,and last labels. Nothing there about the labels in between. – sdjuan May 23 '13 at 15:58
  • Made a little research, and found that for custom page labels you have to create custom pager class. In custom pager class you have to override (at least) `createPageButtons` method. Some examples here: http://www.yiiframework.com/forum/index.php/topic/5776-customise-the-clinkpager/ –  May 24 '13 at 06:10

0 Answers0