
42
Chapter 2: Elements of CFML
CFML custom tags
When you write a custom tag in CFML, you can take advantage of all the features of the
ColdFusion language, including all built-in tags and even other custom tags. CFML custom tags
can include body sections and end tags. Because they are written in CFML, you do not need to
know a programming language such as Java. CFML custom tags provide more capabilities than
user-defined functions, but are less efficient.
For more information on CFML custom tags, see
Chapter 9, “Creating and Using Custom
CFML Tags,” on page 173
. For information about, and comparisons among, ways to reuse
ColdFusion code, including CFML custom tags, user-defined functions, and CFX tags, see
Chapter 8, “Reusing Code in ColdFusion Pages,” on page 163
.
CFX Tags
CFX tags are ColdFusion custom tags that you write in a programming language such as Java or
C++. These tags can take full advantage of all the tools and resources provided by these languages,
including their access to runtime environments. CFX tags also generally execute faster than
CFML custom tags because they are compiled. CFX tags can be cross-platform, but are often
platform-specific, for example if they take advantage of COM objects or the Windows API.
For more information on CFX tags, see
Chapter 12, “Building Custom CFXAPI Tags,”
on page 251
.
Functions
Functions
typically manipulate data and return a result. CFML includes over 250 built-in
functions. You can also use CFScript to create user-defined functions (UDFs), sometimes referred
to as custom functions.
Functions have the following general form:
functionName([argument1[, argument2]]...)
Some functions, such as the
Now
function take no arguments. Other functions require one or
more comma-separated arguments and can have additional optional arguments. All ColdFusion
functions return a value. For example,
Round(3.14159)
returns the value 3.
Built-in functions
ColdFusion built-in functions perform a variety of tasks, including, but not limited to, the
following:
•
Creating and manipulating complex data variables, such as arrays, lists, and structures
•
Creating and manipulating queries
•
Creating, analyzing, manipulating, and formatting strings and date and time values
•
Evaluating the values of dynamic data
•
Determining the type of a variable value
•
Converting data between formats
•
Performing mathematical operations
•
Getting system information and resources
For alphabetical and categorized lists of ColdFusion functions, see
Chapter 3, “ColdFusion
Functions,”
in
CFML Reference
.
Содержание ColdFusion MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...