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 (http://stackoverflow.com/questions/27254540/yii-2-0-multiple-database-connection) 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"?

Thanks!

I believe you can.

Modules have configuration just like applications have.

http://www.yiiframework.com/doc-2.0/guide-structure-modules.html#creating-modules

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