I a test.cfc I have created a component in Application.cfc using
<cffunction name="onApplicationStart">
<cfset application.api = {tst= createObject( "component", "com.Test" )} />
<cfreturn true />
</cffunction>
Now how do I call a method in Test.cfc in my cfm file ?
This code
defines the variable
application.api.tst
. You want define a variable by calling a method in this object (CFC).You can define the variable
list
in two ways:as Sean describes or by using a simple
CFSET
The value of
list
is based on whatever was returned by the functiondoSomething
, which is a public function inside the componentcom.Test
that exists in the application variable.You should be able to output of
CFDUMP
the value oflist
at this point. If the variable does not have the value you expected, then you need to verify what the functiondoSomething
is returning.