Wow. Sorry, I didn't read your entire email. But a few things.. 1) Yes, generally you have just one table per model per controller. 2) A more flexible solution is to have your menu heirarchy to be separate from your controller/action heriarchy. This will allow you to separate your visual navigation from your controller structure. Design your database around the data that you'll be housing. That will then dictate the models/controllers to use. Then once you're happy with the structure, you can then create a menu that can point to any resource, and be structured how you want it. And if you change your mind about how the menu should be displayed, you shouldn't need to change your database/model/controller structure.
Cheers, Adam ----- Original Message ----- From: "Phil" <[email protected]> To: "CakePHP" <[email protected]> Sent: Wednesday, June 17, 2009 7:12 AM Subject: Organization issues and more... My questions aren't exactly about CakePHP, but more so around the MVC architecture. I couldn't find my particular answer through searching, but at least I discovered that this seems like an acceptable question here. I have a main menu. For each main menu item, there is a sub menu. To me, it made more sense that the URL would be /<main_menu_item>/ <sub_menu_item>/, which would be /controller/action/. Because of this, I created a controller for each main menu item, and created actions in the appropriate controller for each sub menu item. My intents are for the user to click the main menu item, and the first sub menu item will be selected by default. As such, I used the index() for each controller to be the first (default) sub menu item. This is where I get confused though. The main menu item is simply for organizational purpose. It is almost as if I shouldn’t even have a controller for the main menu items, but rather, a controller for each sub menu item. I guess I would have to split my current database table up into multiple database tables, one for each controller (sub menu). I guess that also means one model for each controller as well. Does this make more sense? I have further issues, which go a bit further off topic but my main question is about MVC still. On each of these sub menu pages, the information from the database for the authorized user is displayed for the particular section they are on. I wanted to be able to edit this information by clicking on the text displayed and having it turn into a input box for editing. Then, when the user clicks away or presses enter, it turns back into normal text, without the input box. I can do this with Javascript just fine, but I don't know how this fits in with MVC. I guess I would just put it in my view and use it how I would without this framework, except input boxes will be created using the form helper? I really think I would prefer this method of editing over a separate edit page, but if you strongly disagree then constructive criticism is accepted. However, I'm still not entirely sure when the actual saving to the database should take place if I went about it this way. I was thinking it could commit the changes every time the text box turns back into normal text through AJAX, but depending on how many fields are being edited, that could be putting an unnecessary extra load on the server. I suppose it is a design decision I should be asking myself rather than people who are reading this that don't know any details of my project, but I am open for suggestions. The point was that I wanted the page to almost always have a presentation appearance and a bit more of an interactive feel to editing rather than switching entirely to an editing view. Congratulations to those of you who actually read everything. Thanks in advance for any help or insight. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
