Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cfdump alternative to pass output as a string

Tags:

coldfusion

I'd like to store the output of the cfdump as a string temporarily. I know there's a way to store it in a file, but is there a way that I can get the equivalent of cfdump format='text'?

like image 269
Daniel Avatar asked Dec 06 '22 13:12

Daniel


2 Answers

Would using cfsavecontent work for you?

<cfsavecontent variable="theDump">
    <cfdump var="#cgi#" expand="yes" format="text">
</cfsavecontent>

<cfoutput>
    #theDump#
</cfoutput>
like image 169
shaunw Avatar answered Dec 29 '22 02:12

shaunw


shaunw has the right idea. For bonus modularity, roll that into your own custom tag or component function so you can reuse it throughout your applications

like image 40
Michael Schreiber Avatar answered Dec 29 '22 02:12

Michael Schreiber