• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. ColdFusion Components > Building Your First CFC

Building Your First CFC

In this section, we are going to take a look at our first ColdFusion component and call it from a ColdFusion template. ColdFusion components work like regular ColdFusion templates; you can create component files in your webroot directory or any directory under it. Unlike ColdFusion pages, you save component files with the .cfc extension, such as componentName.cfc. In addition, all ColdFusion variable scopes are available to components, including session, client, server, and application.

You use the CFCOMPONENT and CFFUNCTION tags to create ColdFusion components. By itself, the CFCOMPONENT tag does not provide functionality; rather, it provides an envelope that describes the functionality you build in CMFL and enclose in CFFUNCTION tags. Furthermore, ColdFusion components provide some behaviors that are totally new and unique to CFCs and ColdFusion MX, such as web service deployment, description, and communication via SOAP.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint