Spec-Zone.ru › ColdFusion

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

  • CF4+
  • Lucee
  • BL 1.0.0+
  • See Also: cfoutput encodeForHTML

    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

    Output the literal string "Hello World"

    writeOutput("Hello World");

    Output the equivalent string as a variable

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

    Using the encodeFor argument

    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

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/writeoutput

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API