cfdump

Description

Use the cfdump tag to get 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"
top = "number of rows or levels">

See also

cfcookie, cfparam, cfsavecontent, cfschedule, cfset, cftimer, cfwddx

History

Attributes

Attribute Req/Opt Default Description

var

Required

 

Variable to display. Enclose a variable name in number 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.

top

Optional

9999

The number of rows to display. For a structure, this is the number of nested levels to display.

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 "yes">
   <cfdump var="#mydoc#">
</cfif>

The tag output is color-coded according to data type.

If a table cell is empty, this tag displays "[empty string]".

Example

<!--- This example shows how to use this tag to display the CGI scope as a structure: --->

<cfdump var="#cgi#">

View comments in LiveDocs