Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
The <cffunction> Tag
ColdFusion Components usually contain one or more functions (often called methods; the two terms are effectively interchangeable). A function is simply a block of code that performs an operation, and usually returns results. Each function is defined using a tag named <cffunction> and terminated with the matching closing tag </cffunction>.
<cffunction> takes a series of attributes, but only two are really important:
name is the name of the function (it must be unique within the CFC; the same method name may be used in two different CFCs but not twice in the same CFC).
returntype is the type of the results that will be returned (string, date, array, query, etc.).
Listing 11.3 is intro.cfc again, but this time we’ve introduced ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access