0

我尝试了针对此问题的所有建议解决方案,即清除缓存文件夹。我还禁用了缓存Configure::write('Cache.disable', true);我的调试级别设置为 2。但我总是得到同样的错误。缺少的表只是新添加的表。顺便说一句,我只在我的本地主机中运行。这是我的模型,名为 Department.php

 <?php

class Department extends AppModel {

    public $name = 'Department';  
}
?>

这是我的控制器名称 DepartmentsController.php

    <?php
class DepartmentsController extends AppController {

        public $name = 'Departments';
    public $helpers = array('Html', 'Form','Session');
    public $components = array('RequestHandler','Session');


    function index() {
        $this->Department->recursive = 0;
        $this->set('departments', $this->paginate());
    }    
}
?>

提前谢谢你的回答!:D

4

1 回答 1

0

Assuming you are actually using a database I would try the following things:

  1. If your database table isn't named using the cakephp conventions, manually set it:

    public $useTable = 'table_name';

  2. Make sure your database config is using the right database in app/config/database.php

  3. If that model is in a plugin, use the plugin syntax when including it in the controller:

    public $uses=array('PluginName.Department');

于 2013-02-26T19:41:59.363 回答