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" />

<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" />

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.


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


Ha ha :smiley:

1 Like