Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-10-25
2
Medium Priority
?
1,456 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 800 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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