writeOutput

Appends text to the page-output stream.
This function writes to the page-output stream regardless of
conditions established by the cfsetting tag.

writeOutput(string) → returns boolean

Argument Reference

string string
Required

A string, or a variable that contains one

encodeFor string

CF 2016+ Lucee 5.1.0.8+ Wraps the result with an encodeFor function.
Values:
  • html
  • htmlattribute
  • javascript
  • css
  • xml
  • xmlattribute
  • url
  • xpath
  • ldap
  • dn

Examples
Sample code invoking the writeOutput function

writeOutput("Hello World");

greeting = "Hello World";
writeOutput(greeting);

CF 2016+ Passing in html to the encodeFor argument wraps the result with a call to encodeForHTML.

name = "Pete";
writeOutput("Hello " & name, "html");

Expected Result: Hello Pete

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub