Spec-Zone.ru › ColdFusion

cfexit

This tag aborts processing of the currently executing CFML custom tag, exits the page within the currently executing CFML custom tag, or re-executes a section of code within the currently executing CFML custom tag.

<cfexit>

exit;

  • CF3+
  • Lucee
  • BL 1.0.0+
  • See Also: cfabort cferror cfthrow

    Attribute Reference

    method string

    exittag: aborts processing of currently executing tag exittemplate: exits page of currently executing tag loop: reexecutes body of currently executing tag
    Values:
    • exittag
    • exittemplate
    • loop

    Compatibility

    BoxLang:

    Version 1.0.0+ <bx:exit> in BoxLang

    Examples
    Sample code using the cfexit tag

    Simple cfexit example

    Here the loop over the 5 number. When it's meet the condition as true then the block of code get exit.

    <cfoutput>
    <cfloop from="1" to="5" index = "i">
    <cfif i EQ 3>
    	<cfexit>
    <cfelse>
    	#i#
    </cfif>
    </cfloop>
    </cfoutput>

    Expected Result: 1 2

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

    Spec-Zone.ru

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