[英]How can I make sure that every controller sees DboSource?
There were issues that some controllers are using DboSource
methods and I added the一些控制器使用
DboSource
方法存在问题,我添加了
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.
但是,我想知道 Cake 是否有办法确保每个控制器都加载一个类。 My current solution works, I just intend to improve it.
我目前的解决方案有效,我只是打算改进它。 Is this possible?
这可能吗? Thanks!
谢谢!
您可以将其添加到您的app/Config/bootstrap.php
文件中,它将在每个请求时加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.