I want to access a veriable from constant component file in the config/main.php file. For example,
I have a ConfigManager Class in my component dir as
<?php
class ConfigManager {
public static $dbUserName = 'root';
public static $dbPassword = 'test123';
}
?>
And in config file I want to do it like this -
'db'=>array(
'class'=>'CDbConnection',
'connectionString'=>'mysql:host=localhost;dbname=dbname',
'username'=> ConfigManager::$dbUserName,
'password'=> ConfigManager::$dbPassword,
'emulatePrepare'=>true,
),
But it is giving require error. Can't find class ConfigManager. Is it possible to do it like this?
Thanks!

Help














