You use the cffunction
tag to define a UDF in CFML. The cffunction
tag syntax has the following features and limitations:
cffunction
tag provides attributes that enable you to easily limit the execution of the tag to authorized users or specify how the function can be accessed.
The following code uses the cffunction
tag to define the exponentiation function:
<cffunction name="twoPower" output=True> <cfargument name="exponent"> <cfreturn 2^exponent> </cffunction>
For more information on how to use the cffunction
tag to define a function, see Defining functions using the cffunction tag.