cfif

Creates simple and compound conditional statements in CFML.
Tests an expression, variable, function return value, or
string. Used, optionally, with the cfelse and cfelseif tags.

  <cfif>

 if (expression) { }

Examples
Sample code using the cfif tag

count = 10; 
 if (count > 20) { 
 writeOutput(count); 
 } else if (count == 8) { 
 writeOutput(count); 
 } else { 
 writeOutput(count); 
 }

<cfset count = 10> 
 <cfif count GT 20> 
 <cfoutput>#count#</cfoutput> 
 <cfelseif count EQ 8> 
 <cfoutput>#count#</cfoutput> 
 <cfelse> 
 <cfoutput>#count#</cfoutput> 
 </cfif>

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

Fork me on GitHub