我正在处理我的yii2项目并且意外地遇到了这个错误: PHP致命错误 - yii \ base \ ErrorException
未捕获的异常' yii \ base \ UnknownClassException'与消息 '无法找到' yii \ helpers \ VarDumper'在文件中: C:\ WAMP \ WWW \保险\供应商\ yiisoft \ yii2 /助理/ VarDumper.php。 名称空间缺失?'在 C:\ wamp \ www \ insurance \ vendor \ yiisoft \ yii2 \ BaseYii.php:293 Stack trace:
0 [内部函数]:yii \ BaseYii :: autoload(' yii \ helpers \ Var ...')
1 C:\ wamp \ www \ insurance \ vendor \ yiisoft \ yii2 \ base \ ErrorHandler.php(151):
spl_autoload_call(' YII \助手\瓦尔...&#39)
2 C:\ wamp \ www \ insurance \ vendor \ yiisoft \ yii2 \ base \ ErrorHandler.php(121):
YII \基\ ErrorHandler-> handleFallbackExceptionMessage(对象(YII \基\ UnknownClassException), 对象(YII \基\ ErrorException))
3 [内部函数]:yii \ base \ ErrorHandler-> handleException(Object(yii \ base \ ErrorException))
4 {main}抛出.....
我不是yii2的新手,除了我像往常一样添加了VarDumper :: dump($ myvariable,3,true)之外,我还没有做任何事情。 我去了yiisoft \ yii \ helpers \ VarDumper.php:
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\helpers;
/**
* VarDumper is intended to replace the buggy PHP function var_dump and print_r.
* It can correctly identify the recursively referenced objects in a complex
* object structure. It also has a recursive depth control to avoid indefinite
* recursive display of some peculiar variables.
*
* VarDumper can be used as follows,
*
* ```php
* VarDumper::dump($var);
* ```
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
//class VarDumper extends BaseVarDumper
{
}
我不知道为什么!!!