Hi Guys, I've got a question, and hopefully one of the cakephp guys can give an answer.
First, the scenario... I often will used more than one model file to represent the same data. A common reason is to separate admin functions from normal ones, so the normal model is less intensive to load. There may be other reasons like two different data sources, but the same data model. Now although this does not seem a problem at first, it becomes a problem when you start creating forms to represent and manage that data. In all these models, the $name variable is set the same (e.g. User), so I have transparency between the models (and the models may be named: UserModel1, UserModel2 etc). However, when we populate a form with the model data using the FormHelper, it requires the following name: ModelClass.field (1.2) or ModelClass/field (1.1). Now naturally this causes a problem when the models have different class names (This may be so that we can store all the models in the same directory or even load more than one of them at the same time.) Now my only argument or frustration is why does the FormHelper use the Classname as part of the naming of the input field rather than the $name variable of the class? I have no problem in it needing the class name to initiate and retrieve the input name value, but I think that it would be best that the resulting name was: data[ModelNameVariable] [field]. What are your thoughts? Then, the second part of the conventions is why are controller class files named differently to all the other files like models, helpers, components etc? Surely to remain consistent, one should keep the naming convention the same all across? My personal preference would be that they are all named according to their class name, so much like the current controllers are. I understand the impact this would have, but I think that this would help keep a stronger convention on the naming of the files. A third case to look at is if a component and a model share the same $name variable value or Similar class names (Component: User "user_component"; Model: User "user"). This causes a problem. To get around that I named all my components iClassComponent. However, I would think that the best way really to solve this would be to name the objects according to their class names, ie: Models would be UserModel and Components would be UserComponent. This also allows for better usability as you thereby know automatically the type of object it is. What are your thoughts? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
