Yii sets its own CSS style for JUI
Yii sets its own CSS style for JUI
JUI in Yii is really powerful, but many times its own style is not in coordination with our website. For example, I made two skins, one in blue and the other in red, and the self-built JUI is indeed Gray.
Every Jui Widget in Yii inherits CJuiWidget. Therefore, Yii sets theme or themeUrl in each CJuiWidget. But the problem comes again:
If I set CJuiWidget: theme, once I change the topic, I need to modify all the places used in the program.
If I have set CJuiWidget: themeUrl, I cannot know the themeUrl after the topic is changed. even if CTheme is used to specify the current theme address, it cannot be guaranteed that the Jui style is also placed on the themes created by others.
Therefore, it is unreliable to specify the Jui css style in the program. Therefore, to ensure that the subject can be changed at any time, and the Jui part must have the same color as the subject, you can write it in the layout file of the topic as follows:
Theme-> getBaseUrl ();?> /Css/jui/jquery-ui.css "/>
The idea of this code section is that once the CJuiWidget class appears, it means that the current page uses a widget derived from CJuiWidget, we can introduce a css style of the current theme to overwrite the built-in style. In this way, it is the best solution I have come up with to determine whether to use a custom Jui style.
The preceding figure shows how Yii sets its own CSS style for JUI. For more information, see PHP Chinese website (www.php1.cn )!