缺少单元格 class
Cell class is missing
错误:
Cell class Audit.AuditCell is missing. Cake\View\Exception\MissingCellException
插件文件:
plugins/Audit/src/Template/Cell/Audit/model.ctp
plugins/Audit/src/View/Cell/AuditCell.php
中,src/Template/Servers/view.ctp
:
echo $this->cell('Audit.Audit::model', [strtolower($this->request->controller), $this->request->pass[0]]);
中,config/bootstrap.php
:
Plugin::load('Audit', ['bootstrap' => true, 'routes' => true]);
使用 CakePHP 3.3.16
.
编辑 #1
我的快照 IDE:
编辑 #2
我的相关部分 composer.json
"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"
}
我在我的文件中添加了正确的 namespace Audit\View\Cell
。
错误:
Cell class Audit.AuditCell is missing. Cake\View\Exception\MissingCellException
插件文件:
plugins/Audit/src/Template/Cell/Audit/model.ctp
plugins/Audit/src/View/Cell/AuditCell.php
中,src/Template/Servers/view.ctp
:
echo $this->cell('Audit.Audit::model', [strtolower($this->request->controller), $this->request->pass[0]]);
中,config/bootstrap.php
:
Plugin::load('Audit', ['bootstrap' => true, 'routes' => true]);
使用 CakePHP 3.3.16
.
编辑 #1
我的快照 IDE:
编辑 #2
我的相关部分 composer.json
"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"
}
我在我的文件中添加了正确的 namespace Audit\View\Cell
。