Skip navigation.

Creating your first Coldfusion Component Step 2

  Coldfusion Component Step 2

When you use a CFC the name of the function you want to call is used and all the processes in the function is executed.  Now I am going to introduce you to the <cfreturn> tag.


cfreturn: enables you to return a value from the <cffunction> tag

tag: <cfreturn expression>


Example 2


<cffunction name="today returntype="date">

<cfreturn Now()>


<cffunction name="tommarow" returntype="date">

<cfreturn DateAdd("d",1,Now())>