mhm sorry but you're aware of the fat models , thin controllers idea ? imo let's stick to it. in you example you should have a controller with admin_actions and using the same model.
If many of the structures are the same then just put them in the same model and call them from admin/user actions. These action can use the same views if you want. Create one controller with different actions for different users ( you probably should check permissions in the app/controller) and use one model - the data manipulation functions ( M (from MVC) like data Manipulation ;) will be the same. greets, Marcin Domanski On Dec 20, 4:48 pm, lordG <[EMAIL PROTECTED]> wrote: > AD7six, thanks for your feedback. below are some further thoughts. > > > The above sounds rather over complex to me. What is the benefit of > > making several 'models' for one model? (The fact that I ask should > > imply that I don't percieve any of the above reasons as a benefit). > > Here is another example (just an example)... > Lets say we have a dedicated site menu and a dedicated admin menu. The > site menu is stored in table 'site_menu' and the admin one in > 'admin_menu'. Both share the same table structure, so many of the > functions and views for managing them are the same. However, there may > be a few possible functions you may call in the 2 models when saving > that are different to one another. So... by keeping the $name variable > in both the as 'Menu', this means one could use 1 set of controllers > and views to manage both sets of tables, and therefor reduce the > amount of code one writes. > > This is just one theory or example. Lets not debate why one would > create 2 tables that in reality are the same structure. This is merely > an example for us to work with. > > > You are refering to plural or _controller? I can�t remember the > > specifics but when the _controller was dropped there were naming > > conflicts. > > > > 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. > > > If anything were to change I prefer writing less :). > > I agree with what you are saying about writing less. If this is the > case then, perhaps the controller filename would be better being the > same as the helpers, components etc. filename = users.php; class = > UsersController. Then the same theory should perhaps apply to the > models to maintain consistency... filename = user.php; class = > UserModel. Overall this would be adopting better conformity to the > conventions across the files and class names. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
