我有一个 test.cfm
页面,并想用一个cfc调用 <cffunction>
命名 errorEmail
运用 <cfscript>
从该页面(test.cfm)而不是
<cfinvoke component = "#cfcPath#" method = "errorEmail" returnVariable = "myReturn"
description = "get list of projman">
</cfinvoke>
我努力了:
<cfscript>
errorEmail(cfcPath);
</cfscript>
我一直这样做。
1)创建对象:
<cfscript>
// CREATE OBJECT
TheCFC = createObject("component", "thecfc");
</cfscript>
2)调用函数:
<cfscript>
// CALL THE FUNCTION
SomeVariable = TheCFC .theFunction();
</cfscript>
你的版本看起来像这样
<cfscript>
// CREATE OBJECT
TheObject = createObject("component", "cfcPath");
// CALL THE FUNCTION
myReturn = TheObject.errorEmail();
</cfscript>