0

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 ?

  • I've had this same problem when I wasn't loading the model for the plugin correctly. Make sure you use $uses = array('plugin1.Model1') when loading the model in your controller, or else, it'll look in the main application, not find it, then try using a default model, which requires a table with matching name. – Kai Nov 09 '13 at 18:35

1 Answers1

2

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
}
Nik Chankov
  • 6,049
  • 1
  • 20
  • 30