> I've a "Paths" library which is used throughout my
> applications to construct
> the various paths needed for a page.

> Currently when I use many of the functions I must pass in
> the results of
> "CurrentTemplatePath()" to extract the proper path.  It
> would be so much
> simpler if the method call had some knowledge of the
> template which called
> it (I know this breaks encapsulation... but dammit, I
> don't care).

> Any way to get that?  The system path of the calling
> template?

> Is the CF_TEMPLATE_PATH CGI variable reliable enough
> across different HTTP
> servers for example?

Well if you have a CFC which is designed to do something related to
paths, and you pass in a path as an argument, then that's not breaking
encapsulation at all... Using an available variable from the
environment may be seen as breaking encapsulation, although if you
don't plan to use it elsewhere (testing harness, simulations,
providing information to external objects) then the lack of
encapsulation won't be a problem. However, cgi.cf_template_path won't
give you the same information getCurrentTemplatePath() gives you...
there really isn't anything that will give you what
getCurrentTemplatePath() gives you within a CFC. Outside of a CFC you
can use getBaseTagList() to get the calling template for a custom tag,
but the context of the CFC creates a barrier that getBaseTagList()
won't go beyond. As far as I know, cgi.cf_template_path and
cgi.script_name both return some portion of the value of
getBaseTemplatePath() so neither are helpful for what you're asking,
unless of course what you actually want is not what you've been using
(except perhaps incidentally because you're not calling the CFC within
includes or custom tags).

s. isaac dealey     954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214035
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to