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

var variableName
Required

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

expand boolean
Default: true

Yes: 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 structures).

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

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

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

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

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

Outputs a listing of all the variables in the server scope. Only for LUCEE.

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

CF 9+ Specifying the "abort" attribute without corresponding value is equivalent to assigning it with a "true" value. However, when this attribute is excluded, the default value of "false" is applied.

<cfdump var="#server#" abort>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub