CFDUMP ColdFusion Tip of the Day

2
11
Chris Peterson
Chris Peterson

I was idling in #coldfusion on Dalnet this morning and amongst the distorted, haphazard conversations that usually occur in there, an awesome little tidbit of code popped up. Courtesy of Chris Peterson of Alagad fame.

Someone was asking about the formatting of the code that <CFDUMP> spits out and Chris suggested a few scenarios, one of which he said he uses all the time:

<cfdump format=”html” output=”c:\#createUUID()#_dump.html” var=”#whatever#” />

That tasty morsel spits the output to a handy dandy .html file. All these years, I’m ashamed to say I never knew you could do that. Very awesome. Thanks Chris. (yeah yeah yeah, I know, RTFD) 🙂

2 COMMENTS

  1. heh – yeah, that’s an awesome one. i actually have that as a snippet – so i just type df [ctrl+j] and get a prompt for the var i want to dump.

    here’s the whole snippet if you want it – i use dump.html because it will actually append to the file instead of overwriting – so you can keep a running dump log:

    and map it to df (dump file) or whatever you want – then type the shortcut and ctrl+j

    you could also add the pound signs in the snippet to avoid having to enter them in the prompt every time like so:

    another cfdump gem is the ‘abort’ attribute (to avoid the usual cfabort right after the cfdump). just set abort=”true” in the cfdump tag (cf9 only).

LEAVE A REPLY

Please enter your comment!
Please enter your name here