Proposal: CFSaveContent "file" attribute

When it comes to CFSaveContent, I have a common use case where I do something like this:

<cfsavecontent variable="htmlContent">
    <cfinclude template="./cf-logic.cfm" />
</cfsavecontent>

<cfset fileWrite( htmlContent, "./generated.html" ) />

It would be nice if the CFSaveContent tag had a file option, so I could skip that last step:

<cfsavecontent file="./generated.html">
    <cfinclude template="./cf-logic.cfm" />
</cfsavecontent>

Or, I mean, the best thing would also be if there as just some sort of renderToFile() function:

renderToFile( "./cf-logic.cfm", "./generated.html" );

Anyway, just a random thought.

11 Likes

I like it, how do we make you more random?

4 Likes

Ha ha :smiley:

1 Like