Get Calling Template Directory from CFC
Posted on 2006-06-23
Does anyone know how to get the directory path of the calling cfm file in a CFC?
If I use this statement to call a CFC from say this cfm file... c:\websites\mysite\index.cfm
<cfset projects = CreateObject('Component','cfc.projects')>
The following code in the CFC file then tells me that the directory is "c:\websites\mysite\cfc\", but what I want is "c:\websites\mysite\".
<cfset this.rootdirectory = getfilefrompath(gettemplatepath())>