![]() ![]() ![]() |
||
|
You can think of tags as commands that you use to instruct the ColdFusion server to perform operations. These operations might include selecting data from a database, reading a file that resides on the server, or showing the results of processing.
As discussed in Introducing ColdFusion MX, ColdFusion tags are similar to HTML tags. ColdFusion tags are enclosed in angle brackets and often have a start and end tag. The start tag encloses the tag name in brackets, like this:
<tagname>
Most often the end tag encloses the tag name in brackets and includes a forward 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:
Some ColdFusion tags, such as cfset
, omit the ending 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 instruct ColdFusion about the details of an operation. For example, to update a database table, ColdFusion requires specific information 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.
|
||
![]() ![]() ![]() |