Building Coldfusion Components - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Using the GetMetaData function
The CFML
GetMetaData
instance. This structure contains substantially more data about the CFC than
includes the following information:
All attributes to the component tag, including any metadata-only attributes, plus the
component path.
An array of structures containing full information on each method (function) in the
component. This information includes all attributes, including metadata-only function and
parameter attributes.
Within each function structure, a Parameters element containing an array of parameters
specified by
cfargument
attributes.
Information about any properties that are specified using the
For information on how to specify CFC metadata, including how to use component tags and how
to specify metadata-only attributes, see

Building ColdFusion components

You use the
cfcomponent
tag does not provide functionality. Rather, the
cfcomponent
envelope that describes the functionality that you build in CFML and enclose in
tags.
The following example creates a component with two methods:
<cfcomponent>
<cffunction name="getEmp">
<cfquery name="empQuery" datasource="ExampleApps" dbtype="ODBC" >
SELECT FIRSTNAME, LASTNAME, EMAIL
FROM tblEmployees
</cfquery>
<cfreturn empQuery>
</cffunction>
<cffunction name="getDept">
<cfquery name="deptQuery" datasource="ExampleApps" dbtype="ODBC" >
SELECT *
FROM tblDepartments
</cfquery>
<cfreturn deptQuery>
</cffunction>
</cfcomponent>
In the example, two
When invoked, the component methods query the ExampleApps database. The
returns the query results to the client.
The following sections discuss how you define components and their methods.
function returns a structure containing all the metadata of a CFC
tags. Information on each parameter includes any metadata-only
"Documenting CFCs" on page
and
cffunction
tags define two component methods,
cffunction
cfproperty
tags to create ColdFusion components. By itself, the
cfcomponent
Building ColdFusion components
shows, and
cfdump
tag
240.
tag provides an
cffunction
and
.
getEmp
getDept
tag
cfreturn
235

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents