
Understanding CFML elements
19
Most often the end tag encloses the tag name in brackets and includes a slash (/), like this:
</tagname>
The information processed by ColdFusion is placed between the start and end tag, like this:
<tagname>
info to be processed ...
</tagname>
ColdFusion tags, for the most part, share these common characteristics:
•
All start with
cf
.
•
A start and end tag.
•
Use of attributes (like html tags), and most attributes have values.
Some ColdFusion tags, such as
cfset
, omit the closing tag. This type of tag uses one set of angle
brackets and places all the required information between the left (<) and right (>) angle brackets,
like this:
<cfset name="bob">
For a complete list of tags and their syntax, see
CFML Reference
.
Tag attributes
Tag attributes instruct the ColdFusion server about the details of an operation. For example, to
update a database table, the server needs to know specifics about the database, such as the
database name and the table name. The code required to write this type of statement might look
like this:
<cfupdate datasource="mydb" tablename="mytable">
where
datasource
and
tablename
are attributes of the
cfupdate
tag and
"mydb"
and
"mytable"
are attribute values.
For a complete list of tags and their attributes, see
CFML Reference
.
Functions
Typically, a function acts on data. It can generate a value or a set of values, usually from some
input. You can perform the following operations (actions) with functions:
•
Manipulate data and time values
•
Examine a value or variable
•
Display and format information
•
Manipulate string data
•
Retrieve system information and resources
•
Perform mathematical operations
Using functions on values
Usually, a function performs an operation on a value, and the value can include the value of a
variable. For example: to format the value of a variable containing a value in dollars, the code to
write this statement might look like this:
#DollarFormat(price)#
Содержание COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION...
Страница 1: ...Getting Started Building ColdFusion MX Applications...
Страница 6: ...6 Contents...
Страница 10: ......
Страница 30: ...30 Chapter 2 CFML Basics...
Страница 36: ...36 Chapter 3 Database Fundamentals...
Страница 48: ......
Страница 76: ...76 Chapter 6 Lesson 2 Writing Your First ColdFusion Application...
Страница 134: ...134 Index...