Rick Morayniss
03/03/2022, 9:25 PMMyka Forrest
03/03/2022, 9:35 PM<cfinclude />
is used to .cfm files, not .cfc files.
Have you looked through the documentation?
https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/building-and-using-coldfusion-components.htmlfoundeo
foundeo
<cfscript>
allFunc = new AllFunctions();
result = allFunc.addingFunction(1,2);
</cfscript>
foundeo
new folder.sub.AllFunctions()
would assume you have the cfc located at: /folder/sub/AllFunctions.cfc
jakobward
03/04/2022, 2:26 AMjakobward
03/04/2022, 2:27 AMjakobward
03/04/2022, 2:29 AMfoundeo
aliaspooryorik
// Allfunctions.cfc
component {
public numeric function addingFunction(
required numeric firstNumber,
required numeric secondNumber
) {
var sumOfThem = firstNumber + secondNumber;
return sumOfThem;
}
}
aliaspooryorik
aliaspooryorik
<cfscript>
allFunc = new AllFunctions();
result = allFunc.addingFunction(1,2);
</cfscript>
aliaspooryorik
Rick Morayniss
03/04/2022, 2:47 PM