Answered
Dynamic named arguments
Hi,
I have 2 cfc methods one receives 3 arguments, id,fieldid,fieldvalue. Where fieldid is a db column name and fieldvalue is the value of that field. I want to pass this info to another method which accepts many more optional arguments. I would like to use the arguments.field as the name of an argument for the 2nd method
e.g. my2ndmethod(arguments.fieldid=arguments.fieldvalue)
However, this doesn't seem to be working. Is there anyway to do this other than using a switch case on arguments.fieldid and then hardcoding each possible fieldid in each cfcase?
Any ideas/suggestions/workarounds?
Many thanks,
Dave
I have 2 cfc methods one receives 3 arguments, id,fieldid,fieldvalue. Where fieldid is a db column name and fieldvalue is the value of that field. I want to pass this info to another method which accepts many more optional arguments. I would like to use the arguments.field as the name of an argument for the 2nd method
e.g. my2ndmethod(arguments.fieldid=arguments.fieldvalue)
However, this doesn't seem to be working. Is there anyway to do this other than using a switch case on arguments.fieldid and then hardcoding each possible fieldid in each cfcase?
Any ideas/suggestions/workarounds?
Many thanks,
Dave
