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 ifrequiredis 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access