Home arrow ColdFusion arrow Page 2 - Introduction to ColdFusion Markup Language
COLDFUSION

Introduction to ColdFusion Markup Language


If you want to get a good start on learning ColdFusion, look no further. This article covers a whole bunch of CFML tags and some basic functions. It is the first of two parts, and excerpted from chapter three of the book ColdFusion Web Development with Dreamweaver MX 2004, written by Jen and Peter deHaan et al. (Apress; ISBN: 1590592379).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 50
January 19, 2006
TABLE OF CONTENTS:
  1. · Introduction to ColdFusion Markup Language
  2. · Tags Used in CFML
  3. · The Application.cfm File
  4. · Understanding Common ColdFusion Tags
  5. · The cfif tag
  6. · The cfswitch tag
  7. · The cflocation tag

print this article
SEARCH DEVARTICLES

Introduction to ColdFusion Markup Language - Tags Used in CFML
(Page 2 of 7 )

Let's look at some of the tags that make up CFML. This section provides a quick overview of some of the most common tags and their use. This should give you a general idea of what ColdFusion MX 6.1 is capable of. Following later are descriptions and code snippets detailing how to use some of these tags in a ColdFusion page.

ColdFusion MX 6.1 has more than 100 CFML tags, which Macromedia's documentation breaks down into the following categories:

  • Application framework
  • Database manipulation
  • Data output
  • Debugging
  • Exception handling
  • Extensibility
  • File management
  • Flow-control
  • Forms
  • Internet protocol
  • Page processing
  • Variable manipulation

However, what's more important are the specific tags that you will discover you use every day in ColdFusion. Some of the more useful tags are:

  1. <cfchart>: Generates charts on the fly in a variety of formats, including.jpeg,.png, and.swf(Flash).
  2. <cfdirectory>: Performs directory management tasks and allows you to create, delete, rename, or list the contents of a directory.
  3. <cfdump>: Displays the contents of a variable to the screen for debugging purposes. Variables can contain simple values such as strings and numbers, or complex data such as Recordsets and structures.
  4. <cferror>: Tells ColdFusion how to handle errors that occur in your application.
  5. <cffile>: Performs file-management tasks and allows you to read, write, delete, move, rename, or append data to files on the server.
  6. <cfform>: Similar to HTML forms, except that it allows developers to take advantage of automatically generated JavaScript validation provided by the ColdFusion server.
  7. <cfftp>: Allows ColdFusion to FTP files to and from remote FTP sites.
  8. <cffunction>: Allows you to write your own custom functions using CFML tags.
  9. <cfhttp>: Allows you to post variables to remote sites, or grab the contents of a file on a different server.
  10. <cfif>: Performsif ... then ... elselogic in ColdFusion, running code only if certain conditions are met.
  11. <cfinclude>: Embeds other HTML or CFML code into the current document. This allows developers to break up larger files and reuse certain code/functions throughout the site.
  12. <cfinput>: Used in conjunction with the<cfform>tag to take advantage of built-in JavaScript validation.
  13. <cflocation>: Redirects the currently running page to a different page, or redirects users to a different site altogether.
  14. <cfloop>: Allows you to loop over Recordsets and structures a defined number of times, or while a certain condition is true.
  15. <cfmail>: Sends an e-mail to a single user or group of users.
  16. <cfmodule>: Allows you to call your own custom tags with ColdFusion.
  17. <cfoutput>: Used to output the value of a variable, or loop over a Recordset.
  18. <cfparam>: Checks to see if a certain variable exists; if not, it creates the variable and assigns a default value. It can also be used to validate the data type of a variable.
  19. <cfquery>: Used to pass SQL statements to a database.
  20. <cfqueryparam>: Used within<cfquery>to insert dynamic values into a SQL statement.
  21. <cfset>: Define the value of a variable.
  22. <cfstoredproc>: Execute a stored procedure (if supported by your database of choice).
  23. <cfswitch>: Passes control to a matching<cfcase>tag and evaluates passed expressions. This could be performed using a series of<cfif>tags, but this method saves space and simplifies things.
  24. <cftry>: Monitors a block of ColdFusion code and tries to catch any errors that may occur. It is used in conjunction with the<cfcatch>tag.

ColdFusion also has a couple of special files that are triggered before or after every user request and can be used to hold site-wide variables or settings; we will look at these now.


blog comments powered by Disqus
COLDFUSION ARTICLES

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials