CFLib.org – Common Function Library Project

IsCustomTag()

Last updated January 29, 2002

author

Jordan Clark

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Simply returns a boolean value if the tag calling this function was itself called as a custom tag or not. Very important for creating dual-pupose templates which can be cfinclude'd or cfmodule'd.

Return Values:
Returns a Boolean value.

Example:

<cfoutput>
Is this template being called as a custom tag: #IsCustomTag()#
</cfoutput>

Parameters:

No arguments.

Full UDF Source:

/**
 * Returns true/false if the current template is being called as a custom tag.
 * 
 * @return Returns a Boolean value. 
 * @author Jordan Clark (JordanClark@Telus.net) 
 * @version 1, January 29, 2002 
 */
function IsCustomTag() {
  return yesNoFormat( listFindNoCase( getBaseTagList(), "CF_" & listFirst( listLast( getCurrentTemplatePath(), "/\" ), "." ) ) );
}
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