hi,I want the user to press a button and specify which database to use. My issue is that I can change the database easy enough as below but I dont know how to set this new database to every controller. In the appcontroller would be the best place but i dont know how to pass the appcontroller a variable to set the database?
//controller
$connection = ConnectionManager::get(‘db2’); // ‘db2’ where my second database is configured
ConnectionManager::alias(‘db2’, ‘default’);