Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

But I have become passionate about making software.

How to Dump Vars

April 11, 2007

CFDump is one of ColdFusion's best tags. Simply give it a variable and it will output the value no matter its type (array, structure, query, cfc, java, etc it can handle just about everything).

Often I will use it to output a scope like form or url or variables (be careful with this one though as all queries are in this scope by default). The one scope I have not been able to dump is var until yesterday when Jared Rypka-Hauer passed along a tip. To dump the var scope do this:

<cfdump var="#getPageContext().getVariableScope()#">

You may have to adjust the output attribute of your functions.

[UPDATE: 9/5/07: This only works on CF 7, click here for how to do this with ColdFusion 8]

No Comments

Some comments have been lost over the years due to moving hosts.


More blog entries that I have written.

Code coloring by PRISM.