Spec-Zone.ru › ColdFusion

cfset

Sets a value in CFML. Used to create a variable, if it does not exist, and assign it a value. Also used to call functions.

<cfset x = 1>

x = 1;

  • CF
  • Lucee
  • See Also: setVariable

    Examples
    Sample code using the cfset tag

    Script Syntax

    x = y = 1; 
    z = [ 
        !x, 
        x == 1 && y == 2, 
        x == 1 || y == 2 
    ]; 
    writeDump(z);

    Tag Syntax

    <cfset x = y = 1> 
    <cfset z = [ 
        NOT x, 
        x EQ 1 AND y EQ 2, 
        x EQ 1 OR y EQ 2 
    ]> 
    <cfdump var="#z#">

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

    Spec-Zone.ru

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