ColdFusion provides three methods for passing parameters to CFC methods in direct method invocations:
name="value"
entries, as in the following CFScript example:
authorized = securityCFC.getAuth(name="Almonzo", Password="LauRa123");
argumentCollection
structure. The following code is equivalent to the previous example:
argsColl = structNew(); argsColl.username = "Amonzo"; argsColl.password = "LauRa123; authorized = securityCFC.getAuth(argumentCollection = argsColl);
getAuth
method, and passes the name and password as positional parameters:
authorized = securityCFC.getAuth("Almonzo", "LauRa123");
Note: For more information on using positional parameters and component methods in ColdFusion functions, see Creating user-defined functions.