Programming instructions
14 Chapter 2 CFML Basics
Working with ColdFusion pages
As discussed in Chapter 1, ColdFusion pages are plain text files that you use to create web
applications. You can create your ColdFusion applications by writing all the code
manually or by using wizards (provided with some editors) to generate the majority of
the code for you.
You can use the following editors to create your ColdFusion pages:
• Macromedia Dreamweaver MX (discussed in Chapter 4)
• Macromedia HomeSite+ (discussed in Chapter 4)
• Macromedia ColdFusion Studio
• Any HTML editor
• Windows Notepad
• VI or EMACS (UNIX® systems)
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 HomeSite+ for users who are familiar with developing their
application code using ColdFusion Studio or HomeSite 5. HomeSite+ combines all the
features of ColdFusion Studio and HomeSite 5, along with support for the latest
ColdFusion MX tags.
Note: This book shows 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 HomeSite+.
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 book.
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.