Name

cfargument

Synopsis

<cffunction>
  [<cfargument>]
  ...
</cffunction>

Defines one or more arguments for a user-defined function (UDF). Acts as a subtag of cffunction. If used within the context of a ColdFusion Component (CFC), cfargument defines an argument for the method defined in the cffunction tag. cfargument tags must be placed immediately after the cffunction tag, before any other CFML tags are used. Arguments passed into a function/method can be referenced using the argument’s name (# ArgumentName #), the argument’s scoped name (#arguments. ArgumentName #), or by the argument’s index within the arguments array (#arguments[ i ]#).

Besides the named attributes listed below, you can pass any additional desired attributes to the cfargument tag as user-defined attributes. Although these attributes don’t do anything, they are available as metadata when the component containing the method with the cfargument tag is introspected using the GetMetaData( ) function. You may use any attribute names you wish with the exception of those reserved by cfargument: name, displayname, hint, type, required, and default.

Attributes

name=" ArgumentName "

Name of the argument. Required.

default=" Value "

Value to assign the argument if required="No" or if required is not specified and no argument is passed to the function when it is called.

displayname=" display_name "

Used to display a descriptive name for the argument in ColdFusion MX’s Component Browser. Optional.

hint=" text "

Used to display ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.