callStackGet

Returns an array of structs. Each struct contains template name, line number, and function name (if applicable). This is a snapshot of all function calls or invocations.

callStackGet(); → returns array

Examples sample code invoking the callStackGet function


Tag Syntax

This example the factorial of a number is computed.

<!--- callfact.cfm ---> 
 <cftry> 
 <cfinclude template='fact.cfm'> 
 <cfcatch type='any'> 
 <cfoutput> 
 #cfcatch.message# 
 <br> #cfcatch.detail# <br> 
 </cfoutput> 
 </cfcatch> 
 </cftry 
 
 

Script Syntax

This example the factorial of a number is computed.

<!--- fact.cfm ---> 
 <cfscript> 
 numeric function factorial(n) 
 { 
 if(n == 1) { 
 writeDump(callStackGet()); 
 writeOutput('<br>'); 
 return 1; 
 } 
 else { 
 writeDump(callStackGet()); 
 writeOutput('<br>'); 
 return n * factorial(n-1); 
 } 
 } 
 factorial(5); 
 </cfscript> 
 

Fork me on GitHub