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

Chapter 33. ColdFusion Markup Language (... > Creating and Using ColdFusion Compon...

Creating and Using ColdFusion Components (CFCs)

A ColdFusion component consists of one or more functions enclosed in cfcomponent tags. Here's an example of a single-function component named demo.cfc (available on the CD) with a function named demoFunction that returns the text string "This is the result."

<cfcomponent>
    <cffunction name="demoFunction" access="public" returntype="string">
        <cfset result = "This is the result.">
        <cfreturn result>
    </cffunction>
</cfcomponent>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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