adding/retreiving a parameter to/from config/main.php

hi

I wanted to add a parameter to my application to get it like this


Yii::app()->toto

so just like basePath or name , I added it into my config array in main.php

but offcourse I get


Property "CWebApplication.toto" is not defined. 

so my question is what would be the best practise to do something like this ?

You’re doing it horribly wrong. Check the ‘params’ stanza in application/config/main.php. You can add custom settings there and access them via Yii::app()->params.

Thanks Da:Sourcerer just the hint I needed

the variable is accessible like so


Yii::app()->params->toto