How to get meta data for a cfc (component) in ColdFusion

GetComponentMetaData() - get metadata for a cfc

GetComponentMetaData.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GetComponentMetaData function example: how to get metadata for a cfc (coldfusion component)</title>
</head>

<body>
<h2 style="color:Crimson">GetComponentMetaData Function Example</h2>

<cfset MyComponentMetaData=GetComponentMetaData("MyComponent")>

<cfdump var="#MyComponentMetaData#" label="MyComponent.cfc MetaData" >
</body>
</html>


MyComponent.cfc


<cfcomponent output="no" Author="Jones" displayname="Math">
 <cffunction name="Sum" access="remote" returntype="numeric" description="Sum two numbers">
  <cfargument name="Value1" type="numeric" required="yes">
  <cfargument name="Value2" type="numeric" required="yes">
  <cfset Sum=arguments.value1+arguments.value2>
  <cfreturn Sum>
 </cffunction>
</cfcomponent>






More ColdFusion examples