CFLib.org – Common Function Library Project

DebugVars([scopes])

Last updated April 30, 2003

Version: 1 | Requires: ColdFusion MX | Library: UtilityLib

 
Rated 0 time(s). Average Rating: 0

Description:
Output more extensive debugging information than just the CF debug info, using the <cfdump> tag. It fits easiest at the end of the template, but can be placed anywhere.

Return Values:
Returns a string.

Example:

view plain print about
<cfset DebugInfo = DebugVars("url") />
<cfoutput>
  #DebugInfo#
</cfoutput>

Parameters:

Name Description Required
scopes Scopes to display. Must be one of: variables,form,url,request,cookie,session,client,application,server,cgi No

Full UDF Source:

view plain print about
<!---
 Outputs a load of variables for debugging purposes.
 
 @param scopes      Scopes to display. Must be one of: variables,form,url,request,cookie,session,client,application,server,cgi (Optional)
 @return Returns a string. 
 @author Eric C. Davis (cflib@10mar2001.com) 
 @version 1, April 30, 2003 
--->

<cffunction name="debugVars" output="true" returntype="string" access="public" hint="Output more extensive debugging information than just the CF debug info" displayname="DebugVars()">
   <cfargument name="scopes" required="false" default="variables,form,url,request,cookie,session,client,application,server,cgi" hint="Scopes to be dumped" type="string" displayname="Scopes" />
   <cfsavecontent variable="returnVar">
      <cfloop list="#arguments.scopes#" index="myScope" delimiters=",">
         <cftry>
            <cfdump label="#Trim(myScope)#" var="#Evaluate(Trim(myScope))#" />
            <cfcatch>
               <cfoutput>
                  #cfcatch.Message#
               </cfoutput>
            </cfcatch>
         </cftry>
      </cfloop>
   </cfsavecontent>
   <cfreturn returnVar />
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Dave Anderson Dave Anderson added
iniToStruct
20 day(s) ago

Dave Anderson Dave Anderson added
deDupeArray
20 day(s) ago

Richard Richard added
dice
22 day(s) ago

Isaac Dealey Isaac Dealey added
getRelative
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 22 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Kevin Pepperman generateSsccAsn
Rated 5.0, 4 time(s)

Raymond Camden highlightAndCrop
Rated 5.0, 4 time(s)

Created by Raymond Camden / Design by Justin Johnson