User Guide

98 Chapter 2: ColdFusion Tags
cfdump
Description
Outputs the elements, variables and values of most kinds of ColdFusion objects. Useful for
debugging. You can display the contents of simple and complex variables, objects, components,
user-defined functions, and other elements.
Category
Debugging tags, Variable manipulation tags
Syntax
<cfdump
var = "#variable#"
expand = "Yes or No"
label = "text">
See also
cfcookie, cfparam, cfsavecontent, cfschedule, cfset, cfwddx
History
ColdFusion MX 6.1: Added the ability to dump COM objects; it displays the methods and Get
and Put properties typeinfo information for the object.
Attributes
Usage
The expand/contract display capability is useful when working with large structures, such as XML
document objects, structures, and arrays.
To display a construct, use code such as the following, in which myDoc is a variable of type
XmlDocument:
<cfif IsXmlDoc(mydoc) is "True">
<cfdump var="#mydoc#">
</cfif>
The tag output is color-coded according to data type.
Attribute Req/Opt Default Description
var Required Variable to display. Enclose a variable name in pound signs.
These kinds of variables yield meaningful
cfdump displays:
array
CFC
COM object
Java object
simple
query
structure
UDF
wddx
xml
expand Optional Yes Yes: In Internet Explorer and Mozilla, expands views
No: contracts expanded views
label Optional A string; header for the dump output.