Well I cannot use a writing to main config file because these databases would be "dynamic". All I need is the possibility to create a new database connection using a $database_name that I provide.
I am making a website with multiple front ends. For each user to have his own front end I need to provide him with a separate database. Database name is made out of his username+dtb for example "user222_dtb". I resolve a username from URL and find out which database needs to be loaded. Now I need to create new connection at runtime, but it seems, that Yii ignores is. I call new connection in the controller that should load an index page, but Yii doesnt pay attention and still loads data from the default database (which is in config).