Creates a parameter definition within a component definition. Defines a function argument. Used within a cffunction tag.
<cfargument name="">
myFunction(required any myArgument){}
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | string | Yes | An argument name. | |
type | string | No | a type name; data type of the argument. | |
required | boolean | No | no | Whether the parameter is required to execute the component method. |
default | string | No | If no argument is passed, specifies a default argument value. | |
displayname | string | No | Meaningful only for CFC method parameters. A value to be displayed when using introspection to show information about the CFC. | |
hint | string | No | Meaningful only for CFC method parameters. Text to be displayed when using introspection to show information about the CFC. The hint attribute value follows the displayname attribute value in the parameter description line. This attribute can be useful for describing the purpose of the parameter. |
For Script syntax the argument is inside the ()
public boolean function myFunction(required any myArgument) {
// Some function bits
return true;
}
For Tag syntax the argument is its own tag
<cffunction access="public" returntype="boolean" name="myFunction">
<cfargument required="true" type="any" name="myArgument">
<!--- Some function bits --->
<cfreturn true>
</cffunction>