<cfproperty>

Defines components as complex types that are used for web services authoring.

The attributes of this tag are exposed as component metadata and are subject to inheritance rules.

Note: Lucee does not support 'lazy' attribute in cfproperty.

This tag cannot have a body.

This tag is also supported within <cfscript>

<cfproperty name=string type=string required=boolean default=string displayname=string hint=string access=string getter=boolean setter=boolean >
Attribute Description
name
string, required

A string; a property name. Must be a static value.

type
string, optional

A string; a property type name; data type.

required
boolean, optional

Whether the parameter is required

default
string, optional

This sets the default value on the property when the object is created.

displayname
string, optional

A value to be displayed when using introspection to show information about the CFC. The value appears in parentheses following the property name.

hint
string, optional

Text to be displayed when using introspection to show information about the CFC. This attribute can be useful for describing the purpose of the parameter.

access
string, optional

The client security context from which the method can be invoked

getter
boolean, optional

Specifies whether to generate getter methods or not

setter
boolean, optional

Specifies whether to generate setter methods or not

Examples

Sample syntax

<cfproperty name="UnitId" column="unit_id" unique="true" fieldtype="id" type="string" />

See also