CLinkPager CSS classes #191

Closed
qiangxue opened this Issue Feb 15, 2012 · 3 comments

4 participants

@qiangxue
Owner

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


earlier comments

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.

http://php.net/manual/en/language.oop5.late-static-bindings.php

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

http://www.yiiframework.com/doc/guide/1.1/en/topics.theming#skin,
http://php.net/manual/en/language.oop5.properties.php ;)

cebe.cc said, at 2012-02-13T23:06:56.000Z:

Oh man, sorry...

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

Contributor
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?

Owner
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.

Owner
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