Class 'App\Controller\Debugger' not found error with cakephp ver3

偶尔善良 提交于 2019-12-12 05:39:37

问题


I am using cakephp 3.0.2. I tried to use Debugger::dump($date_taken_year); and encountered the error Error: Class 'App\Controller\Debugger' not found. If I remove the line that uses Debugger::dump(), the error disappears and the controller function runs smoothly.

I have checked that inside app.php, I have this line 'debug' => true,. Do I have to do anything else to use Debugger class? I had no problems when using cakephp ver2.x


回答1:


It seems, you only forgot to import namespace, proper use would be

use Cake\Error\Debugger;
// ...
Debugger::dump($date_taken_year);


来源:https://stackoverflow.com/questions/30069894/class-app-controller-debugger-not-found-error-with-cakephp-ver3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!