How can I call a cffunction that is saved on a .cfm page from a .cfm page?

I have a cffunction that was written with a .cfm extension page instead of .cfc. I want to call that function but I'm not sure how. Is it the same way as a .cfc?

<cfset myCFC = createObject( 'component', 'path.to.my.cfm.page.with.function' ) />

Did not seem to work for me but if somebody else can verify that would work or let me know a different way that would be great.

Thanks,

Brian
brihol44Asked:
Who is Participating?
 
gdemariaConnect With a Mentor Commented:
the createobject is used for a cfc only.  The function inside of a .cfm file is just a function, you call it directly (no create object).

Just cfinclude the page holding the function and call it...


<cfset theResult = myFunction(this, that)>
0
 
brihol44Author Commented:
ok, that makes sense. I just wondered if there was another way but that works.

thanks!
0
All Courses

From novice to tech pro — start learning today.