问题描述
我使用cakephp 3.0.2。我试图使用 Debugger :: dump($ date_taken_year);
并遇到错误错误:类'App\Controller\Debugger'未找到
。如果我删除使用 Debugger :: dump()
的行,错误消失,控制器功能运行顺利。
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.
我已经检查了在app.php里面,我有这行'debug'=> true,
。我必须做任何其他使用Debugger类吗?我使用cakephp ver2.x时没有问题
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
推荐答案
看来,你只是忘了导入命名空间, / p>
It seems, you only forgot to import namespace, proper use would be
use Cake\Error\Debugger;
// ...
Debugger::dump($date_taken_year);
这篇关于类'App\Controller\Debugger'没有找到与cakephp ver3的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!