/ Published in: ColdFusion
create a basic ColdFusion Component and return a value. This will return a string value based on a string parameter passed into it
Expand |
Embed | Plain Text
<cfcomponent output="false"> <cffunction name="myMethod" output="false" returntype="string" access="public"> <cfargument name="myArg" required="false" type="string"> <cfset var myString = "This is my string " & #myArg# & "was passed to my CFC" > <cfreturn myString> </cfcomponent> You can implement the following CFC as follows: <cfinvoke component="myCFC" method="myMethod" myArg="myValue" returnvariable="myResult"> <cfoutput> #myResult# </cfoutput>
You need to login to post a comment.
