How can I make sure that every controller sees DboSource?

41 Views Asked by At

There were issues that some controllers are using DboSource methods and I added the

App::uses('DboSource', 'Model/DboSource');

line to the class file of some base controllers from which other controllers are inherited. However, I wonder whether there is a way in Cake to make sure that a class is loaded by every controller. My current solution works, I just intend to improve it. Is this possible? Thanks!

1

There are 1 best solutions below

0
ifunk On BEST ANSWER

You can add this to your app/Config/bootstrap.php file and it will be loaded on every request.