Lee Loftiss
Lee Loftiss

Reputation: 3205

CakePHP model named 'Model' not working

I have a model named Model. After some frustration with its responses, I came to the conclusion that the class file is not being used.

To test this, I changed the name of the file from model.php to model_x.php and no errors were encountered.

Can someone verify to me if Model is an invalid name for an appModel class?

I am using CakePHP 2.x

Lee

Upvotes: 0

Views: 118

Answers (1)

Jelmer
Jelmer

Reputation: 2693

The class Model is already taken

So what you should do is create another name. It's the same when using a controller and model named layout, because the Layout folder in View is already used for the layouts. So you should either come up with a clever solution with routing, or simply give it a different name.

Upvotes: 7

Related Questions