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,207 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
ID: 39602199
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
ID: 39602227
ok, that makes sense. I just wondered if there was another way but that works.

thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
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 …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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