> Why isn't all of that retrieval logic in the controller? I.e. you > generate all the data you want in your controller, and you simply loop > on your retrieved data in the vew.
Ah, see I'm totally with you on this... I have a quite specific problem though: each type of template needs a specific set of data. So for instance the monthly update might want all items of types A, B and C with status confirmed and rating > 3, whereas the weekly update might want something completely different. The controller does not know what the template needs, and I kind of need to keep it that way. I want to be able to add a new kind of report without having to add specific code for that report type in the controller. (Obviously I could for instance add a function in the reports controller for each report type, but want to keep the controller clean.) > You will find that it is phenomenally slow if you requestAction all > your data, and btw the second parameter for requestAction is an array > - anything in it is received by the requestedAction.(but please, don't > use requestAction to turn MVC into spaghetti). I didn't realise that requestAction had performance implications, thanks for pointing that out. It does indeed go against MVC a little bit. My problem is that the template (which is the view) needs to pull the data, which inherently is un-MVC. Or can anyone think of a better way of structuring the code? As I said I've considered having an include file that fetches the data, but would like to have a single file if possible. Thanks S --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---