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");

Attribute Reference for the cfdump tag

var

Required: Yes
Variable to display. Enclose a variable name in pound
signs.

expand

Required: No
Default: YES
Yes: In Internet Explorer and Mozilla, expands views

label

Required: No
A string; header for the dump output.

top

Required: No
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

Required: No
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

Required: No
CF 8+ hide column or keys.

keys

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

metainfo

Required: No
Default: YES
CF 8+ Includes information about the query in the cfdump results.

output

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

show

Required: No
CF 8+ show column or keys.

showUDfs

Required: No
Default: YES
CF 8+ show UDFs in cfdump output.

abort

Required: No
Default: NO
CF 9+ stops further processing of page

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