I have few functions which i am trying to call from other CFCs using mappings
but i had clutterred all functions with external functions calls like this:
function a() {
b = new mynewpage.cfc.functionb(arguments);
}
function c() {
c = new mynewpage.cfc.pages.functionc(arguments);
}
so i am trying to focus on creating one function called as invokeme
function invokeme() {
c = new mynewpage.cfc.pages.functionc(arguments);
b = new mynewpage.cfc.functionb(arguments);
}
nut my question is how can use the invokeme
function to use in function a and function b
should i use invokeme.b.a()
I think something like this should work. I'm not 100% sure though in your context because I don't know what those other functions are doing.
For example: https://cffiddle.org/app/file?filepath=0def2e60-5ae3-466e-96de-f80bbbd2d78a/302995b7-ed73-48eb-bf97-598d4a825058/9184f40d-05b5-464e-ae49-45450787edf5.cfm
Essentially you nee to return the instance out of the function for use so the result of invokeme will be keys which are references to those instances. Then you can call them. I think this slightly complicates your code. I think it's cleaner to assign the instances explicitly instead of hidden in a function.