CFPARAM

Used to check if a variable exists, and validates its type and value. If the specified variable doesn't exist a default value can also be supplied at this point.

Usage

<cfparam>

Attributes

Attribute default required summary
NAME Provide a name for the parameter to be checked.
DEFAULT A value to be applied to this parameter if it does not exist at the time of this check.
TYPE ANY By providing a data type to validate the expected parameter (e.g. QUERY, STRUCT), an error will be thrown if the wrong type is passed in. Other type options include "range", "regex" or "regular_expression" to validate the value of a parameter.
MIN The minimum value this parameter should have, only used when TYPE = "range". This is a required attribute when TYPE = "range".
MAX The maximum value this parameter should have, only used when TYPE = "range". This is a required attribute when TYPE = "range".
PATTERN A javascript regex pattern this parameter should conform to, only used when TYPE = "regex" or "regular_expression". This is a required attribute when TYPE = "regex" or "regular_expression".