CLinkPager CSS classes #191

qiangxue opened this Issue Feb 15, 2012 · 3 comments

4 participants


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

earlier comments 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, ;) said, at 2012-02-13T23:06:56.000Z:

Oh man, sorry...

Replacing "const " with "public $" makes sense, yes ;-)

rinatio commented Feb 21, 2012

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' ....)

property with

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?

cebe commented Feb 21, 2012

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.

samdark commented Oct 6, 2012

Already fixed by #382.

@samdark samdark closed this Oct 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment