Solved

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

Posted on 2013-10-25
2
1,114 Views
Last Modified: 2013-10-25
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
0
Comment
Question by:brihol44
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 200 total points
Comment Utility
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
 

Author Closing Comment

by:brihol44
Comment Utility
ok, that makes sense. I just wondered if there was another way but that works.

thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now