June 18th, 2013, 02:07 AM
Sorry if I am being too stupid. I am new to CakePHP and was wondering if a Model name actually needs to be similar to Controller name for it to work properly (without any tweaks).
I have seen general convention guide saying Controller name should be plural of Model name with a 'Controller' suffix, but at the same time I have seen models named as 'Activity' and Controller named 'ActivitiesController' (instead of Activitys). I know in actual english grammer, Activities is right, but how does CakePHP recognize such associations? Or does the Model name actually have nothing to do with Controller name?
June 18th, 2013, 03:34 AM
in code igniter, it has to be slightly different otherwise when you call something like
$this->Activity->dostuff(); php will moan (probably) as it doesnt know if you are referring to Model or Controller?
June 18th, 2013, 05:38 AM
You can have a controller that doesn't use any model, or many models both through the $uses member variable.
Originally Posted by Shefeer
Uses the Inflector class to do the pluralization.
Comments on this post
I ♥ ManiacDan & requinix
This is a sig, and not necessarily
a comment on the OP:
don't be a help vampire