Module with different db connection

Hi all,

I have a yii2 app that use a single db connection. Now I need to add a module that should use a different db connection.

I’ve tried this solution ( but I don’t want to edit all my “standard” model to use the db1.

There is a way to say "use db2 only inside the module"?


I believe you can.

Modules have configuration just like applications have.

Haven’t tried this myself, but yes: it is possible.