cfdump

Outputs the contents of a variable of any type for debugging purposes. The variable can be as simple as a string or as complex as a cfc component instance.

 <cfdump var="">

 writeDump(var = cgi, label = "CGI Scope");

cfdump Attribute Reference

var variableName
Required

Variable to display. Enclose a variable name in pound
signs.

expand boolean
Default: true

Yes: In Internet Explorer and Mozilla, expands views
Values:
  • true
  • false

label string

A string; header for the dump output.

top numeric

CF 7+ The number of rows to display. For a structure, this is the number of nested levels to display (useful for large stuctures).

format string
Default: text

CF 8+ specify whether to save the results of a cfdump to a file in text or HTML format
Values:
  • html
  • text

hide string

CF 8+ hide column or keys.

keys numeric

CF 8+ For a structure, number of keys to display.

metainfo boolean
Default: true

CF 8+ Includes information about the query in the cfdump results.
Values:
  • true
  • false

output string
Default: browser

CF 8+ Where to send the results of cfdump.
Values:
  • browser
  • console
  • filename

show string

CF 8+ show column or keys.

showUDfs boolean
Default: true

CF 8+ show UDFs in cfdump output.
Values:
  • true
  • false

abort boolean
Default: false

CF 9+ stops further processing of page
Values:
  • true
  • false

Examples sample code using the cfdump tag


Dump Server Scope (Tag Based)

Outputs a listing of all the variables in the server scope.

<cfdump var="#server#" label="Server Scope">

Dump Server Scope (Script Based)

Outputs a listing of all the variables in the server scope.

writeDump(var = server, label = "Server Scope");

Dump Then Abort

CF 9+ Instead of using a boolean for the abort-Attribute to abort after a dump, it works like that:

<cfdump var="#server#" abort>

Fork me on GitHub