Johnny,

Once cffile has read the literal text of the file, leaving the raw code of 
the template in the variable, you can't render it without saving it to a 
file and then cfincluding the file. :) Circular, no?

But... cfsavecontent can be used for many, many different things... for 
instance:

<cffunction name="dump" access="public">
<cfsavecontent variable="result"><cfdump var="#variables#" 
/></cfsavecontent>
</cffunction>

from within a CFC, this can be handy as a troubleshooting tool.

There isn't anything else that works the way cfsavecontent does, with the 
possible exception of a cfhttp call to a purpose-built template and setting 
cfhttp.filecontent to a var... and that won't work in many cases.

It's a handy tag.

Laterz,
J

On 6/21/05, Johnny Le <[EMAIL PROTECTED]> wrote:
> 
> Hi,
> 
> I noticed lately that a lot of people are using cfsavecontent instead of 
> cffile, like this:
> 
> <cfsavecontent variable="content">
> <cfinclude template="pageToRead.cfm">
> </cfsavecontent>
> 
> vs.
> 
> <cffile action="read" file="c:\web\pageToRead.cfm" variable="content"/>
> 
> I would think cffile is more intuitive than cfsavecontent, and it is only 
> one line to type. So are there real benefits to use cfsavecontent over 
> cffile? I heard that cffile is slower than cfsavecontent. Is that the only 
> reason?
> 
> Johnny
> 
> 


-- 
---------------
-------------------------------------
Buy SQLSurveyor!
http://www.web-relevant.com/sqlsurveyor
Never make your developers open Enterprise Manager again.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210176
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to