0

In PHP for example you can do:

<?= var_dump($myVariable); ?>

And see a dump of the entire variable with all it's available properties. How can you do this in a coldfusion template with a .cfm extension (in other words in the view layer not controller)?

James A Mohler
  • 11,060
  • 15
  • 46
  • 72

1 Answers1

5

You are looking for <cfdump var="#myVariable#">. If you use the script-syntax (cfscript), it's writeDump(myVariable);.

Note that dumping within a function or component might not display anything due to how the output buffer works in CF. In this case, use the abort="true" attribute of cfdump or abort manually after the dump by placing <cfabort> (cftag) or abort; (cfscript).

Alex
  • 7,743
  • 1
  • 18
  • 38