On Tue, 20 Jul 2004 23:57:18 -0700, Sean Corfield <[EMAIL PROTECTED]> wrote: > On Tue, 20 Jul 2004 23:12:06 -0400, Dave Carabetta <[EMAIL PROTECTED]> wrote: > > Yes Sean, this summary is correct. > > Good, that means I'm not losing it... :) > > > 1) If I have cfsetting enablecfoutputonly="yes" at the top of my > > calling code, I need to put cfoutput around my cfsavecontent syntax > > within my CFC methods. Otherwise nothing is saved in the cfsavecontent > > variable. > > Well, all my methods are output="false" and if I need to use > cfsavecontent I'd expect to use cfoutput (that's how quite a bit of my > recent code works that generates XML). I don't think this is at all > surprising when you think about it...
Ha. Well, it was suprising to me until Dave Watts pointed out that cfsavecontent is implemented in a custom-tag like fashion. In my mind, before knowing that, I just thought that the tag would save the content directly to the variable without using the output buffer. > > 2) If I'm uploading a file, the CFC apparently has access to the form > > scope in some way. If I pass in a literal string called > > "form.uploadFile" then the CFC can somehow "reach in" to the form > > scope of the calling page and get the file. > > Not really, it's more the way cffile works - it needs the name of the > form scope variable, not the value... odd, but true. And that's > nothing to do with CFCs really. I realize it's the cffile implementation as opposed to the CFC implementation, but I just feel "dirty" directly accessing the form scope from inside my CFC, which is, in effect, what it's doing. My point there was that I thought that CFCs were completely isolated from the calling environment (outside of the "this" scope). However, that is obviously not the case, and I was curious as to whether or not this is a good thing. > > > Does that question make sense? Any insight is appreciated. > > I'm not sure either of these are really issues if you follow best practices... Can you elaborate a bit? I'm not really sure what best practices has to do with what I was asking. I do follow best practices (output="false" in both the cfcomponent and cffunction tags, init() methods in all my CFCs, no direct references to shared scopes, etc.). But how does following those practices change the fact that a cfsetting tag on the calling page effects the cfsavecontent output in a CFC? Further, how does following best practices alleviate the fact that the CFC directly references the form scope, which is something we should avoid? I'm just saying that I don't quite grasp why it's "OK" for the two scopes (the CFC scope vs. the calling scope) to be able to "bleed" into each other. Regards, Dave. ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
