Adobe COLDFUSION 9 Manual page 23

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
Note: You cannot embed comments inside a tag name or function name, such as
You also cannot embed comments inside strings, as in the following example:
.
>Variable")
Tags
ColdFusion tags tell the ColdFusion server that it must process information. The ColdFusion server only processes tag
contents; it returns text outside ColdFusion to the web server unchanged. ColdFusion provides a wide variety of built-
in tags and lets you create custom tags.
Tag syntax
ColdFusion tags have the same format as HTML tags. They are enclosed in angle brackets (< and >) and can have zero
or more named attributes. Many ColdFusion tags have bodies; that is, they have beginning and end tags with text for
processing between them. For example:
<cfoutput>
Hello #YourName#! <br>
</cfoutput>
Other tags, such as
and
cfset
(<) character and the ending (>) character, as in the following example:
<cfset YourName="Bob">
Note: The
tag differs from other tags in that it does not have a body or arguments. Instead, the tag encloses an
cfset
assignment statement that assigns a value to a variable. The
to a result variable.
Sometimes, although the tag can have a body, it is unnecessary because the attributes specify all the required
information. You can omit the end tag and place a forward slash character before the closing (>) character, as in the
following example:
<cfprocessingdirective pageencoding="euc-jp" />
In most cases, you specify tag attributes directly in the tag using the format attributeName
preceding example shows. However, as an alternative, you can place all the attributes in a structure and specify the
structure in a single
attributeCollection
<tagname attributeCollection="#structureName#">
When you use this format for all built-in ColdFusion tags except
attribute. This format is useful when you use dynamic arguments, where the number and
attributeCollection
values of the arguments to a tag can vary based on processing results. The following example shows this usage:
, never have bodies. All the required information goes between the beginning
cfhttp
cfset
attribute, using the following format:
Last updated 8/5/2010
<cf_My<!--- New --->CustomTag>
IsDefined("My<!--- New ---
tag can also call a function without assigning a value
attributeValue
="
, the tag must have only the
cfmodule
18
.
, as the
"

Advertisement

Table of Contents
loading

Table of Contents