ColdFusion 9.0 Resources |
cfobject: component objectSyntax<cfobject component = "component name" name = "instance name" type = "component"> Note: You can
specify this tag’s attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
See alsocfcollection, cfcomponent, cfexecute, cfindex, IsInstanceOf, cfreport, cfsearch, cfwddx; Using ColdFusion components in the Developing ColdFusion Applications Attributes
UsageWhen the cfobject tag creates an instance of the CFC, ColdFusion executes any constructor code in the CFC; that is, it runs code that is not in the method definitions. On UNIX systems, ColdFusion searches first for a file with a name that matches the specified component name, but is all lowercase. If it does not find the file, it looks for a filename that matches the component name exactly, with the identical character casing. Example<!--- Separate instantiation and method invocation; ---> <!--- permits multiple invocations. ---> <cfobject name="quoteService" component="nasdaq.quote"> <cfinvoke component="#quoteService#" method="getLastTradePrice" symbol="macr" returnVariable="res"> <cfoutput>#res#</cfoutput><br> <cfinvoke component="#quoteService#" method="getLastTradePrice" symbol="mot" returnVariable="res"> <cfoutput>#res#</cfoutput> |