Thanks, Brian. That is exactly what I needed. On Apr 13, 1:40 pm, brian <[email protected]> wrote: > On Mon, Apr 13, 2009 at 2:06 PM, Joseph Roberts > > > > <[email protected]> wrote: > > > Greetings fellow bakers, > > > I need help with a development project where I work at a rescue > > mission. I am creating a volunteer management system that involves > > many models such as: groups, jobs, volunteers, skeleton_jobs and > > scheduled_jobs. Being new to CakePHP, this is my quandary: How do I > > implement MVC in this case? > > > I would like to haveoneview, let's call it volunteer_manager.ctp, > > that accesses information fromallthese aforementioned models and > > displays the data in <div> tags in an iTunes-esque display so that > > everything is ononescreen (i.e. mini calendar, scrollable divs for > > lists of groups, volunteers and jobs). I have a prototype working with > > drag and drop capability, but am running into issues with > > requestAction. Some resources I've read have said requestAction is a > > "bad practice." > > > That being said, how to I utilize data from a number of MVC > > relationships in a singleviewwithout using requestAction? Should I > > turn the groups, departments, volunteers, and jobs into elements that > > are included within volunteer_manager.ctp? Each of these elements > > requires the basic CRUD functions. Perhaps I'm not conceptualizing > > elements properly, but from the Cookbook's description they seem to be > > rather limited display aids rather than full blown MVC relationships. > > I need help understanding elements or a viable alternative because the > > relationships in this app are getting complicated and I don't want to > > design myself into a corner. > > > For instance, when I click on a date in the mini calendar not only is > > the calendar div updated, but the jobs div should be updated to > > reflectallavailable jobs for that day AND the groups, volunteers, > > and scheduled jobs should be updated as well. This requires a number > > of requestAction calls as it now stands. > > > Perhaps I should get away from Ajax calls to update the individual > > <div> tags in volunteer_manager.ctp, but I don't want to reload the > > screen (and reload every bit of data in the divs) just becauseonediv > > element needs to change. > > You can use a generalised manager ontroller to fetch the data from > several models. Whether you include those other models in the > controller's $uses array or use ClassRegistry::init() as needed is up > to you (maybe you don't wantallof the models loaded for every > action). > > You can still use ajax to make changes. Just point the requests to the > appropriate controller. The link may be in aviewfor > volunteer_manager but it can point to any other controller.
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
