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
Required

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

expand
Default: YES

Yes: In Internet Explorer and Mozilla, expands views

label

A string; header for the dump output.

top

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
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

CF 8+ hide column or keys.

keys

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

metainfo
Default: YES

CF 8+ Includes information about the query in the cfdump results.

output
Default: browser

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

show

CF 8+ show column or keys.

showUDfs
Default: YES

CF 8+ show UDFs in cfdump output.

abort
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