Skip to content

Instantly share code, notes, and snippets.

Created December 21, 2013 10:39
Show Gist options
  • Save anonymous/8067756 to your computer and use it in GitHub Desktop.
Save anonymous/8067756 to your computer and use it in GitHub Desktop.
Code example of invoke() in action, for Luis.
<cfscript>
// invokeOnRailo.cfm
test = new Test();
methodToCall = "f";
writeOutput("<h3>invoke() with name/value pairs</h3>");
invoke(test, methodToCall, {one="tahi", two="rua", three="toru", four="wha"});
writeOutput("<h3>invoke() with ordered arguments</h3>");
invoke(test, methodToCall, ["tahi","rua","toru","wha"]);
</cfscript>
// Test.cfc
component {
public void function f(){
writeDump(var=arguments);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment