
16
Chapter 2: CFML Basics
The best choice for creating ColdFusion pages is Macromedia Dreamweaver MX. Dreamweaver
MX includes many CFML features for building applications, such as rapid visual development,
robust CFML editing, and integrated debugging. Dreamweaver MX also includes a copy of
H for users who are familiar with developing their application code using ColdFusion
Studio or HomeSite 5. H combines all the features of ColdFusion Studio and
HomeSite 5, along with support for the latest ColdFusion MX tags. For more information, see
Chapter 5, “Lesson 2: Configuring Your Development Environment,” on page 49
.
Note:
This manual describes how to create ColdFusion applications by writing your code manually. It
does not address how to create ColdFusion pages by generating code with wizards. For information
about using wizards to generate CFML code, see the product documentation for Dreamweaver MX
and H.
Creating a ColdFusion page
Creating a ColdFusion page involves using tags and functions. The best way to understand this
process is to create a ColdFusion page.
In the following procedure, you will create a simple ColdFusion page by using HTML tags, one
ColdFusion tag, and two ColdFusion functions. The following table briefly explains the
ColdFusion tags and functions:
Note:
ColdFusion tags and functions are considered primary elements of CFML. You will learn more
about these elements and others later in this manual.
To create a ColdFusion page:
1.
Open your editor and create a blank file.
2.
Enter the following code on the page:
<html>
<head>
<title>A ColdFusion Page</title>
</head>
<body>
<strong>Hello world, this is a ColdFusion page.</strong>
<br>
<cfoutput> Today’s date is #DateFormat(Now())# </cfoutput>
</body>
</html>
Element
Description
Now()
A function supported in CFML that you can use to retrieve information from your
system.
You will use the
Now()
function in the following procedure to return the current date
that is retrieved from your system.
DateFormat()
A function that instructs ColdFusion to format the date returned by the
Now()
function.
cfoutput
A ColdFusion tag that you use to return dynamic data (data retrieved from a
database) to a web page.
You will use the
cfoutput
tag in the following procedure to display the current date
retrieved from your system.
Содержание COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION...
Страница 1: ...COLDFUSION MX7 Getting Started Building ColdFusion MX Applications...
Страница 6: ...6 Contents...
Страница 10: ......
Страница 14: ...14 Chapter 1 Introducing ColdFusion MX...
Страница 38: ...38 Chapter 3 Database Fundamentals...
Страница 40: ......
Страница 58: ...58 Chapter 5 Lesson 2 Configuring Your Development Environment...
Страница 70: ...70 Chapter 6 Lesson 3 Retrieving Data...
Страница 84: ...84 Chapter 7 Lesson 4 Building Dynamic Queries...
Страница 96: ...96 Chapter 8 Lesson 5 Creating a Trip Detail Page...
Страница 102: ...102 Chapter 9 Lesson 6 Creating a Main Application Page...