O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required