Could you make CLinkPager::CSS_* constants as public properties, it would be easier to customize it (in skins for example) to use css frameworks like twitter bootstrap.
Migrated from http://code.google.com/p/yii/issues/detail?id=3172
cebe.cc said, at 2012-02-13T18:47:26.000Z:
Think this would not help you, since they are used inside the class with the self keyword. As of PHP 5.2.x which yii 1.1.x supports there is no late static binding and thus overiding of the constants will have no effect on the existing CLinkPager code.
maschingan said, at 2012-02-13T20:51:55.000Z:
I'm not asking to add late static binding. I'm asking to make them public properties
cebe.cc said, at 2012-02-13T23:06:56.000Z:
Oh man, sorry...
Replacing "const " with "public $" makes sense, yes ;-)
Hello guys. I would like to fix this issue, but I'm not sure about public properties for each page button css class. It would probably be fastest approach in execution time, but maybe there is another more elegant way?
I would add some sort of
$cssOptions = array('firstPage' => ..., 'nextPage' ....)
return CHtml::tag('li', $this->cssOptions['nextPage'], CHtml::link($label,$this->createPageUrl($page)));
in CLinkPager::createPageButton. Maybe private with getter and setter. But it would work slower and may break back compatibility if someone extends this class. What do you think?
I think properties are the best way, also for documentation. If you have an array it is not that clear which key should be set in there.
So you created pull request #382 further discussion should be there.
Already fixed by #382.