Saves the generated content inside the tag body in a variable.
<cfsavecontent variable = "variable name"> content </cfsavecontent>
cfcookie,
cfparam,
cfregistry,
cfschedule,
cfset
Attribute |
Description |
---|---|
variable |
Required. The name of the variable in which to save the generated content inside the tag. |
This tag saves everything in the body of the cfsavecontent
tag, including the results of evaluating expressions and executing custom tags, in the specified variable.
The following example uses a custom tag to generate a report and saves the report in the variable content. It then replaces all instances of the word "report" with the phrase "MyCompany Quarterly Report" and outputs the result.
<cfsavecontent variable="content">
<CF_OutputBigReport> </cfsavecontent> <cfoutput> #replace(content, "report", "MyCompany Quarterly Report", "all")# </cfoutput>