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

Using ColdFusion Components

ColdFusion Components are used by other ColdFusion code, although rather than used, CFCs are said to be invoked. A special tag is used to invoke ColdFusion Components, and not surprisingly the tag is named <cfinvoke>. To invoke a ColdFusion Component you’ll need to specify several things:

  • The name of the CFC to be used.

  • The name of the method to be invoked (CFCs may contain multiple methods).

  • The name of a variable that should contain any returned data.

  • In addition, if the CFC method being invoked accepts arguments, those arguments are to be provided.

Listing 11.6 is a simple file named testcfc.cfm. As its name suggests, it tests the CFC file you just created.

Listing 11.6. testcfc.cfm—CFC Tester Step 1
<!--- Name: testcfc.cfm ...

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