Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 35

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Features of properties with setter and getter methods include the following:
• Component properties you assign with the set method are in the Variables scope that is private to the CFC. You
can get or reset the properties only by calling get or set methods.
• If a property has a type attribute value, ColdFusion validates the data you pass to the setter function. The default
attribute has no effect on the property and does not set an initial property value.
• A direct assignment statement, such as
if you specify the property in a
access using the set and get methods. In fact, you can have a
that you access using the set and get methods.
• Use the
tag getter and setter attributes to control access to a property from outside the CFC:
cfproperty
A setter attribute value of true allows application code to set the property (the default behavior).
A false value specifies that the property can only be set from within the CFC. The getter attribute works similarly.
• Explicit set or get methods override the implicit set and get methods. Therefore, if a CFC has a
with an explicit
setMyProp
uses your function and not an implicit function.
Validate and validateparams attributes
The
attribute available with
validate
setter for this property is called. It takes the following validators:
• string
• boolean
• integer
• numeric
• date
• time
• creditcard: A 13-16 digit number conforming to the mod10 algorithm.
• email: A valid e-mail address.
• eurodate: A date-time value. Any date part must be in the format dd/mm/yy. The format can use /, -, or . characters
as delimiters.
• regex: Matches input against pattern specified in
• ssn: A U.S. social security number.
• telephone: A standard U.S. telephone number.
• UUID: A Home Universally Unique Identifier, formatted 'XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXX',
where 'X' is a hexadecimal number.
• guid: A Universally Unique Identifier of the form "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" where
'X' is a hexadecimal number
• zipcode: U.S., 5- or 9-digit format ZIP codes
The
attribute available with
validateparams
in the validate attribute. This should be specified in the implicit struct notation.
• min: Minimum value if validate is integer/numeric/
myCFC.MyProp=27
tag. The
cfproperty
This
method, and you call the
setMyProp()
takes the validator to be used for validating data when implicit
<cfproperty>
validateparams
<cfproperty>
Last updated 1/20/2012
creates a standard
scope variable in the CFC, even
This
scope variable is independent of the properties that you
scope variable with the same name as a property
This
function in your application code, ColdFusion
.
takes the parameters required by the validator specified
30
property
MyProp

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents