I'm new to the land of coldfsuion having come from a php background of several years. In PHP i've always had affiliations with the smarty templating engine which has a somewhat similiar style in coldfusion to cfm's if you were to call them templates.
I generally code in cfscript objects and in both cfscript and normal cfml can't find any way to return the result of an include (either with include in cfscript or cfinclude in a cfm) as a string.
We use this very often in smarty so you effectivly compile the given template and return the result as a string to display as a variable in anthher template somewhere else. I cn see that include doesn't have a return type so it's obviously in itself not the answer but if anyone knows a way of doing what i'm asking or can shed some light that would be great.
An example would be an email i want to send... something like...
var mail = new Mail();
function String getContents()
return the result of the include here from a given cfm (e.g. include "template.cfm")
All help appreciated!!
Read up on <cfsavecontent> / savecontent:
CFScript version, "savecontent":
Mate you are an absolute champion. The words I was using to search google etc found nothing leaning towards what I was after. Looks like that will do the trick.
lol and to think the example I use of mail actually has an example on the very doc page. Sorry to waste your time.