MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 201

Developing coldfusion mx applications
Table of Contents

Advertisement

Attribute
Description
roles
(Optional) A comma-delimited list of security roles that can invoke this method. If
you omit this attribute, ColdFusion does not restrict user access to the function.
If you use this attribute, the function executes only if the current user is logged in
using the
the attribute. Otherwise, ColdFusion throws an unauthorized access exception. For
more information on user security, see
on page
output
(Optional) Determines how ColdFusion processes displayable output in the function
body.
If you do not specify this option, ColdFusion treats the body of the function as normal
CFML. As a result, text and the result of any
body are displayed each time the function executes.
If you specify True or "yes", the body of the function is processed as if it were in a
cfoutput
surround the variables and expressions with pound signs.
If you specify False or "no" the function is processed as if it were in a
The function does not display any output. The code that calls the function is
responsible for displaying any function results.
You must use
cfargument
precede any other CFML code in
immediately following the
attributes:
Attribute
Description
name
The argument name.
type
(Optional) The data type of the argument. The type of data that is passed to the function.
The valid standard type names are any, array, binary, boolean, date, guid, numeric,
query, string, struct, uuid, and variableName. If you specify any other name, ColdFusion
requires the argument to be a ColdFusion component with that name.
ColdFusion throws an error if you specify this attribute and the function is called with
data of a type that ColdFusion cannot automatically convert to the one you specified.
For example, if the argument
an array.
required
(Optional) A Boolean value specifying whether the argument is required, If set to True
and the argument is omitted from the function call, ColdFusion throws an error. The
default is False.
Because you do not identify arguments when you call a function, all
specify required arguments must precede any
arguments in the
default
(Optional) The default value for an optional argument if no argument value is passed.
If you specify this attribute, an error occurs if you specify this attribute and set the
attribute to True.
required
Note: The
cfargument
can take an indeterminate number of arguments. If you do not use the
argument, reference it using its position in the Arguments scope array. For more information see
"Using the Arguments scope as an array" on page
tag and is a member of one or more of the roles specified in
cfloginuser
345.
tag. ColdFusion displays variable values and expression results if you
tags for required function arguments. All
cffunction
opening tag. The
cffunction
type
definition.
cffunction
tag is not required for optional arguments. This feature is useful if a functions
Chapter 16, "Securing Applications,"
cfoutput
tag body. Therefore, put the
cfargument
attribute is numeric, you cannot call the function with
cfargument
196.
Creating user-defined functions
tags in the function definition
cfsilent
tags must
cfargument
tags
cfargument
tag takes the following
tags that
cfargument
tags that specify optional
tag for an optional
cfargument
tag.
201

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents