Re: Multiple functions/views at once?

2006-11-12 Thread [EMAIL PROTECTED]

Synchro wrote:
 I expect a page to be the result of many functions
 displaying many views at once. ... Do I
 need to build layout back-ends in my controllers in order to call
 multiple functions and gather relevant views together? But that makes a
 controller do a view's job as presentation structure ends up in
 controller logic...

I don't see that preparing data and getting them ready for presentation
is a view's job. I think it's exactly a controller's job, that of
moving information from model(s) to view(s). Certainly a model can't do
that, as it's responsible to be a well from which one can call up some
category of data in a specified array format.

A controller and each of its views are inextricably linked by the
particular controller function specifically built to support a
particular view. The division between controller function and view is
not well defined, except that the view is supposed to be a largely rote
visual specialist while the controller is intended as an active
information collector.

Experience shows that the whole ensemble is easier to create and modify
if the controller does everything which cannot be concisely
accomplished within the view's visual structure.

At least, that's my own perspective on the matter. It is ready to be
corrected by others who have spent more time in this neck of the woods.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Re: Multiple functions/views at once?

2006-11-12 Thread [EMAIL PROTECTED]

One further point. If a single view (here exemplified by an html page)
consists of several different, perhaps only loosely related visual
sections, I suggest that its controller's function  should consists
largely of calls to a number of routines which prepare the data
packages for each of those visual sections.

I guess those routines should be elements if they are expected to be
reused by other controllers. Otherwise I imagine they should just be
support functions, presumably controller methods.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Multiple functions/views at once?

2006-11-10 Thread Synchro

I'm new to cake, and so far it's mostly going ok. Most of the stuff
I've done so far so far uses the simple one controller function, one
view approach. That's fine as far as it goes, but I need to do multiple
things at once. While I can see that the user can only make a single
request at once, I expect a page to be the result of many functions
displaying many views at once. So what acts at a higher level than a
view in order to coordinate this? A layout? But as layouts are just
codeless shells, what determines which code gets run to fill it? Do I
need to build layout back-ends in my controllers in order to call
multiple functions and gather relevant views together? But that makes a
controller do a view's job as presentation structure ends up in
controller logic... What have I missed?


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---