CFLib.org – Common Function Library Project

IsHomeCircuit()

Last updated June 26, 2002

author

Joshua Shaffner

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Useful function for applications in Fusebox 2 to determine whether a template is calling itself or not. If a template is calling itself, isHomeCircuit will return true, otherwise, it will return false.

Return Values:
Returns a boolean.

Example:

<cfif isHomeCircuit()>
  I am at home.
<cfelse>
  I am not at home.
</cfif>

Parameters:

No arguments.

Full UDF Source:

/**
 * a template calling itself is at home, otherwise, its not at home.
 * 
 * @return Returns a boolean. 
 * @author Joshua Shaffner (joshua@curlyweb.com) 
 * @version 1, June 26, 2002 
 */
function IsHomeCircuit(){
	var baseDir=getDirectoryFromPath(getBaseTemplatePath());
	var currDir=getDirectoryFromPath(getCurrentTemplatePath());

	if(baseDir is currDir) return true;
	else return false;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson