我有一个错误:
PHP致命错误- yii\base\ErrorException类‘后端\components\XMLReader’未找到。
我正在使用框架Yii,并希望在组件中使用XMLReader。
<?php
namespace backend\components;
class XMLRead {
public function parse() {
// Instanciation de la classe XMLReader
try {
$xml = new XMLReader();
} catch (Exception $e) {
$e->getMessage();
}
}
} 发布于 2018-06-07 13:35:10
你应该用XmlReader作为考试对象
use omgdef\fias\console\base\XmlReader;
我不知道你用的是哪种包装。但这是可行的
https://github.com/OmgDef/yii2-fias
这里还有一些回购的例子
您应该使用项目中的命名空间。
https://stackoverflow.com/questions/50742366
复制相似问题