cfcomponent and cfinvoke - invoke a method of a component
cfcomponent.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfcomponent and cfinvoke tag example: how to invoke a method of a component</title>
</head>
<body>
<h2 style="color:DodgerBlue">ColdFusion cfcomponent and cfinvoke example</h2>
<cfinvoke
component="DataViewer"
method="GetTableData"
DSname="cfdocexamples"
Table="Employees"
returnvariable="qTableData"
>
<cfdump var="#qTableData#">
</body>
</html>
DataViewer.cfc
<cfcomponent hint="Table Data Viewer">
<cffunction name="GetTableData" access="remote" returntype="query">
<cfargument name="DSname" type="string" required="yes">
<cfargument name="Table" type="string" required="yes">
<cfquery name="qTable" datasource="#arguments.DSname#">
SELECT * FROM #arguments.Table#
</cfquery>
<cfreturn qTable>
</cffunction>
</cfcomponent>
- cfinvoke - invoke a method of a component
- cfgrid - display data in a flash format grid
- cfgrid - display data in a applet format grid
- cfgrid - display data in a html format grid
- cflocation - redirect a page with token
- cfquery - insert data
- cfdbinfo - get table name list from a datasource
- cfdbinfo - get system table name list from a datasource
- cfdbinfo - get column list from a table