This extension is used for read and save config as variables. 简单的设置存储器。
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/components
- Set up component 'config' in main.php
Usage ¶
See the following code example: ~~~
Get config item: ¶
[php] Yii::app()->config->get('site_name', 'Default'); [/php]
Set config item: ¶
[php] Yii::app()->config->set('site_name', 'Yii Site); [/php]
Change Log ¶
March 3, 2010 ¶
- Initial release.
Configuration and comments
To use this extension, you have to add into your configuration file following code:
... 'components' => array ( ... 'config' => array ( 'class' => 'application.extensions.XConfig', ), ... ), ...
It is also worth noticing, that comments inside this extension's source files are not in English (Chinese?), so English-speaking users won't find them useful.
For English speaking users, config extension seems to be a better solution. It also introduces use of caching component, which is a vital part of app, when storing settings in DB rather than in a file!
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.