Hooray, I managed to crack this little sucker
Here's my scenario
I have a model called Bin, which holds bundles of Rawmaterial (timber). A Bin has a particular size which is stored in the the bin table as
sizeId, every sizeId has a text value, for example 50x114, which is the dimensions for a piece of timber. I wanted the text value of the size to be the internal pages' label attribute value. qiang, I know you said to override the createPageButton(…) method, but I ended up overriding the createPageButtons() method so that the section about the internal pages could be exposed.
I'll explain in more detail below, exactly how I did this
To get a all Bins, with sizes order from small to large, I set the $criteria->order. Even though, I already have $bins object with sizes returned from the db, it unfortunately does not give me all the sizes back because of the limit that is being applied to CPagination, so I created another CDbCriteria object, called $criteriaSizes, and also ordered it in ascending order, the same as $criteria's. I stored the results from $criteriaSizes in a $sizes array with numbered array keys and the corresponding sizeText value from a helper class I've written, following the Yii Blog example.
The $sizes array looked something like this
I then passed the sizes array to the list view, and then passed it on to the widget that creates the pagination
Then I extended the CLinkPager class and override the createPageButtons() method and declared a public variable called sizes, of type array.
I passed the $sizes array as $label parameter to the createPageButon() method, with the for loop iterator to match the correct size text from the $sizes array, and voila, new labels
NOTE: This will only work if PAGE_SIZE in your controller is set to 1
Here's a screenshot below