In my Yii2 (basic application) web.php I configure a NULL db connection as 2nd database connection.
This needs to be filled with valid parameters which are coming from a record on the main db connection:
'db' => require(__DIR__ . '/db.php'),
'db2' => [
'class' => 'yii\db\Connection',
'dsn' => NULL,
'username' => NULL,
'password' => NULL,
'charset' => 'utf8',
],
After initializing the app() i need to fill out the NULL parameters with values that i retrieve from another database to further use it in models.
How can i achieve this in Yii2?