Hey guys,
Say I have the following method:
cffunction name=foo access=public returntype=struct output=false
cfargument name=arg1 type=string required=True /
cfset var result= structNew() /
cfset result.output = True /
cfreturn result /
/cffunction
I can obviously do the
in this case the methodRet will equal the structure result with output as a
key. Is there a way in the cfinvoke syntax to specify that methodRet should
equal result.output ?
I do not think so, method chaining is one of the big reasons people like to use
the createObject() function for
Definately, and I agree, but there are times when I am passing several
arguments to a method I prefer to use cfinvoke because it makes the
code much easier to follow in case I or anyone else has to come back
to it. And I have no problem with following the cfinvoke with a cfset
afterwards to get
If readability for lots of arguments is your concern, what about creating a
structure?
cfset myArgs = StructNew() /
cfset myArgs.foo = myVar1 /
cfset myArgs.bar = myVar2 /
cfset methodRet = component.foo(argumentCollection=myArgs).output /
4 matches
Mail list logo