oceatoon
(Oceatoon)
July 20, 2011, 3:15pm
1
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.
oceatoon
(Oceatoon)
July 21, 2011, 6:22am
3
Thanks Da:Sourcerer just the hint I needed
the variable is accessible like so
Yii::app()->params->toto