Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 162

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
Attribute
Description
The function name.
name
returnType
(Optional) The type of data that the function returns. The valid standard type names are: any, array, binary,
Boolean, date, guid, numeric, query, string, struct, uuid, variableName, xml, and void. 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 tries to return data with a type that
ColdFusion cannot automatically convert to the one you specified. For example, if the function returns the result
of a numeric calculation, a returnType attribute of string or numeric is valid, but array is not.
(Optional) A comma-delimited list of security roles that can run this method. If you omit this attribute, ColdFusion
roles
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
and is a member of one or more of the roles specified in the attribute. Otherwise, ColdFusion throws an
unauthorized access exception. For more information on user security, see
(Optional) Determines how ColdFusion processes displayable output in the function body.
output
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
If you specify
variable values and expression results if you surround the variables and expressions with number signs (#).
If you specify
any output. The code that calls the function is responsible for displaying any function results.
Use
tags for required function arguments. All
cfargument
tag body. Therefore, place the
cffunction
tag takes the following attributes:
cfargument
Attribute
Description
The argument name.
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
is numeric, you cannot call the function with an array.
required
(Optional) A Boolean value that specifies whether the argument is required. If set to
omitted from the function call, ColdFusion throws an error. The default value is
not required if you specify a
Because you do not identify arguments when you call a function, all
arguments must precede any
default
(Optional) The default value for an optional argument if no argument value is passed. If you specify this attribute,
ColdFusion ignores the
Note: The
tag is not required for optional arguments. This feature is useful if a function can take an
cfargument
indeterminate number of arguments. If you do not use the
using its position in the Arguments scope array. For more information see
page 162.
tags in the function definition body are displayed each time the function executes.
cfoutput
true
or
yes
, the body of the function is processed as if it is in a
false
or
no
., the function is processed as if it is in a
cfargument
tags immediately following the
cfargument
default
attribute.
cfargument
tags that specify optional arguments in the
required
attribute.
cfargument
Last updated 1/20/2012
"Securing
Applications" on page 339.
cfoutput
tag. ColdFusion displays
cfsilent
tag. The function does not display
tags must precede any other CFML code in a
cffunction
true
and the argument is
false
. The required attribute is
cfargument
tags that specify required
cffunction
tag for an optional argument, reference it by
"Using the Arguments scope as an
157
cfloginuser
tag
opening tag. The
attribute
type
definition.
array" on

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents