• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Name

cfswitch

Synopsis

                   <cfswitch expression="expression">
  <cfcase value="value" delimiters="delimiter">
  HTML and CFML
  </cfcase>
  <cfcase value="value" delimiters="delimiter">
  HTML and CFML
  </cfcase>
  ...
  [<cfdefaultcase>
  HTML and CFML
  </cfdefaultcase>]
</cfswitch>

Evaluates an expression against multiple values until a match is made. Once a match has been made, cfswitch passes control to the appropriate cfcase tag where additional action can take place. If no value matches expression, the code between the cfdefaultcase tags is executed. As of ColdFusion MX, the cfdefaultcase tag no longer has to be coded as the last statement in a cfswitch block, although it is considered good style to do so.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint