views:

364

answers:

2

Hello!

I'm newbie to CakePHP but got strange error. I'm just testing it, how to implemetn many functions and got strange error. Created controller called 'about' and got following error:

 Error:  Database table abouts for model About was not found.

Does CakePHP require to have DB table for every single controller?

PS... var $useTable = false; is not working.

CakePHP 1.2.5

+6  A: 

Try using this in your controller

var $uses = array();

The $usesTable=false is used in models that don't have associated tables.

Michael Anderson
A: 

Controller needs model and model needs table. You can create model without controller but you can't use controller without model. in this case you must create proper model for your controller (but it seems that you made mistake by naming it 'about')

you should add about method to your main application controller (and then you will not need to create about model)

dfens
A model doesn't need a table. You can implement a mock model and even a model that communicates through REST APIs to other websites.
Tor Valamo
@runge, thanks for letting me know, I just used KohanaPHP before when I was able to create controller without model, but quit it due to lack of documentation.@Michael Andresson: Your method is working too, then no need to create model.@Tor Valamo: Thanks! :)
Johannes
@Tor Valamo: my mistake, thx mate
dfens

related questions