简体   繁体   中英

Missing database table - CakePHP

I have a CakePHP project having 3 plugins: plugin1, plugin2, plugin3. These are simple plugins, I've just tried to split up my project into 3 smaller & easier parts. Plugin1 has to use a model "Model1", where there is no db table for this table. And Cake is showing error : "Missing Database Table Error: Table models1 for model Model1 was not found in datasource default."

Here, table-name and Model-name are in correct convention. I don't want to create a table for this, since I don't need it. What to do now ?

You can set that model is without table by setting $useTable in the model (from CakeBook )

class Example extends AppModel {
    public $useTable = false; // This model does not use a database table
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM