Hi, I’m developing a new module M3, which has to access data from a second database. All my models depend on this database m3, which is already added to config.php. Is there a best practise to switch the database within the module , e.g. in mod.m3.php?
I added a service in addon.setup.php
'services' =>array(
'm3db' => function ($addon) {
return new Database('m3');
}
)
Is this a solution? But how do my models know where to be retrieved?
Thanks for help.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.