Php 单元格类丢失
错误: 插件文件:Php 单元格类丢失,php,cakephp,cakephp-3.0,Php,Cakephp,Cakephp 3.0,错误: 插件文件: Cell class Audit.AuditCell is missing. Cake\View\Exception\MissingCellException 在,src/Template/Servers/view.ctp: plugins/Audit/src/Template/Cell/Audit/model.ctp plugins/Audit/src/View/Cell/AuditCell.php 在,config/bootstrap.php: echo $this-
Cell class Audit.AuditCell is missing. Cake\View\Exception\MissingCellException
在,src/Template/Servers/view.ctp
:
plugins/Audit/src/Template/Cell/Audit/model.ctp
plugins/Audit/src/View/Cell/AuditCell.php
在,config/bootstrap.php
:
echo $this->cell('Audit.Audit::model', [strtolower($this->request->controller), $this->request->pass[0]]);
使用CakePHP 3.3.16
编辑#1
我的IDE的快照:
编辑#2
mycomposer.json的相关部分
Plugin::load('Audit', ['bootstrap' => true, 'routes' => true]);
我在我的文件中添加了正确的
名称空间审核\View\Cell
。我在我的文件中添加了正确的名称空间审核\View\Cell
。可能类名有误,可能文件不可访问(权限),可能文件不存在于环境中,可能插件未包含在自动加载程序中,…ndm自动装弹机?bootstrap.php还是composer.json?我正在bootstrap.php ATM.composer.json
中加载插件,分别是根据其中的信息生成的自动加载器。添加了bootstrap.json部分…在您的文件AuditCell.php中,是否有以下名称空间:namespace Audit\View\Cell;可能类名中有输入错误,可能文件不可访问(权限),可能文件不存在于环境中,可能插件未包含在autoloader中,@ndm autoloader?bootstrap.php还是composer.json?我正在bootstrap.php ATM.composer.json
中加载插件,分别是根据其中的信息生成的自动加载器。添加了bootstrap.json部分…在您的文件AuditCell.php中,是否有以下名称空间:namespace Audit\View\Cell;
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "3.3.*",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"adayth/cakephp-cipher-behavior": "^1.0"
},
"autoload": {
"psr-4": {
"App\\": "src",
"Audit\\": "./plugins/Audit/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests",
"Audit\\Test\\": "./plugins/Audit/tests"
}