在我的情况下,错误是:
Fatal error: Uncaught Error: Class 'ErrorHandler' not found in C:\[path]\core\cake\libs\object.php on line 211
(!) Error: Class 'ErrorHandler' not found in C:\[path]\core\cake\libs\object.php on line 211
试图访问http://localhost/user_accounts/index
我已经在应用程序创建视图时错误是发生在我身上\意见\ user_accounts \ index.ctp,含以下内容:
<div>
Text from div
</div>
我已经创建了收藏克控制器以及在应用\控制器\ user_accounts_controller.php:
<?php
class UserAccountsController extends AppController {
public function index() {
// Render the view in /views/user_accounts/index.ctp
$this->render();
}
}
?>
由于我不相关联的模型到该控制器,我是缺少这样的:var $uses = array();
。如果错误更加明确,它会为我节省时间,比如“您没有与此控制器关联的模型”。
此修复程序是:
<?php
class UserAccountsController extends AppController {
// Use this controller without a need for a corresponding Model file.
var $uses = array();
public function index() {
// Render the view in /views/user_accounts/index.ctp
$this->render();
}
}
?>