Skip navigation.
Home

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.

Define:

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

tag: <cfreturn expression>

 

Example 2

<cfcomponent>

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

<cfreturn Now()>

</cffunction>

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

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

<cffunction>

</cfcomponent>