already done this. Also CController is a subclass of CComponent when you drill down. What I wanted to know was what I’m missing in my controller as I really couldt see anything special in other components that we can set stuff from there.
* Loads configuration data from a file and merges it with the existing configuration.
* A config file must be a PHP script returning a configuration array (like the following)
* return array
* 'name'=>'My Application',
* @param string configuration file path (if using relative path, be aware of what is the current path)
* @see mergeWith
public function loadFromFile($configFile)
I would imagine that if your controller is a module controller, you probably would need to add the path alias for the controller’s config/ folder to your <ModuleName>Module.php file so Yii can find it.
I figured out how to do it though i moved the variable from the controller to my web application class.
The configuration then became:
I can then access it by doing
the params array is nice but sometimes it’s nicer to not have to type the access statment for the params.
I’m also working with a multi file configuration and some configurations are set in the common framework and some are set by the actual application and the common framework uses the settings that are set by the app.