savecontent(content)
Last updated March 30, 2014
Version: 1 | Requires: CF10 | Library: CFMLLib
Description:
Best to just read this: http://cfmlblog.adamcameron.me/2014/03/how-about-this-for-savecontent.html
Return Values:
A string containing the captured content
Example:
days = ["R?hina","R?t?","R?apa","R?pare","R?mere","R?horoi","R?tapu"];
contentViaFunction = savecontent(function(){
var decoratedDays = days.map(function(v){
return "<li>#v#</li>";
});
writeOutput("<ul>#decoratedDays.toList('')#</ul>");
});
writeOutput(contentViaFunction);
Parameters:
Name | Description | Required |
---|---|---|
content | A function containing the processing to capture the content of | Yes |
Full UDF Source:
/**
* Implements CFSAVECONTENT as a function
* v1.0 by Adam Cameron
*
* @param content A function containing the processing to capture the content of (Required)
* @return A string containing the captured content
* @author Adam Cameron (dac.cfml@gmail.com)
* @version 1.0, March 30, 2014
*/
string function saveContent(required function content){
savecontent variable="local.saved" {
content();
}
return local.saved;
}
Search CFLib.org
Latest Additions
Raymond Camden added
QueryDeleteRows
November 04, 2017
Leigh added
nullPad
May 11, 2016
Raymond Camden added
stripHTML
May 10, 2016
Kevin Cotton added
date2ExcelDate
May 05, 2016
Raymond Camden added
CapFirst
April 25, 2016