Multi Database Connections

Hi all. I just decided to use Yii2 as the framework of my new application which will be a challenge to make. I installed it, got the advanced template running and then stripped nearly everything of the template out and went to a ‘start’ point.

The app starts perfectly.

Now this is the case. I have a ‘admin’ section (like the backend) and a ‘client’ section (like the frontend). The main database is configured in the common section. It works too. What I was wondering is if this next part is possible:

Go to the ‘client’ with something in the url like ‘target=db1’. Then when loading the connection information for db1 is looked up in the main database and used to create the connection for the ‘client’. On file level I know I can make a config file for the ‘admin’ and ‘client’.

I don’t need the complete step by step implementation, just the thoughts if it’s possible or not.