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 <cfargument> Tag

The functions defined thus far are simple ones, in that they accept no data and return a result. But many of the functions that you’ll create will need to accept data. For example, if you were creating a CFC function that returned movie details, you’d need to pass the desired movie ID to the function.

In CFC lingo, passed data are called arguments and the tag that is used to define arguments is the <cfargument> tag. If used, <cfargument> must be the very first code within a <cffunction>, and multiple <cfargument> tags may be used if needed.

Tip

You may sometimes see the word parameter used too. Parameters and arguments are one and the same.

The following code snippet demonstrates the use of <cfargument>:

<cfargument name="radius" ...

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