The Dev Pages

A knowledge base for web applications development (and beyond)

Check out the link, and learn how to use pass arguments to Coldfusion methods using the argumentCollection as your parameter. This is slick.

I was doing the following, concatenating my argument list to change with logic. I should have been using an argument struct instead of a clumsy string that was being evaluated like this:

argsColl = "";
argsColl &= "username=Almonzo,";
argsColl &= "password="LauRa123";
authorized = securityCFC.getAuth(Evaluate(argsColl));

The following was so much cooler, cut my code down, and made it so I didn’t have to figure out why the Evaluate function won’t evaluate strings with commas:)

argsColl = structNew();
argsColl.username = "Almonzo";
argsColl.password = "LauRa123";
authorized = securityCFC.getAuth(argumentCollection = argsColl);

Helpful link:

Add A Comment