Joe Lakey wrote, On 4/2/2007 10:47 AM:
I like this explanation of what a controller is and does; it clarifies
the controller concept a little for me. I have a couple of follow-up
newbie questions:

1. Should the user action (i.e. clicked link or submitted form) go to a
controller cfc or to a cfm page that interacts with the controller cfc?


I'm not aware that you could have it go directly to a CFC and run anything (it would ask you to log in to view the documentation, unless you've set something up to do it differently)...

2. How should the controller cfc direct the browser to the view layer:
cfincluding the view page, redirecting with cflocation, or something
else?

I like cfincluding, as it allows you to get the state correct before rendering. For example, if the user logs in, and you have already rendered the menu before performing the login action, the menu will not have changed to reflect the new actions available to the user. I suppose you could do something similar with cflocation, and I would do so in cases where it is appropriate: for example, there was an interrupt created somewhere that needs attention and it doesn't make sense to keep them on the same page. But in general, I'd still be using cfinclude to render the page that was arrived at by the cflocation.

I hope that made any sense.

Others will have their views as well, and good reasons for them. Those are mine, and I offer a money back guarantee if you aren't satisfied =)

-Sam





You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to