> The documentation claims that GetCurrentTemplatePath()
> returns "The absolute path of the page that contains the
> call to this function, as a string."

> This is probably true of most callers, but it's not true
> when Application.cfm is the calling page. The returned
> path varies, depending upon which page implicitly includes
> Application.cfm.

> So, two questions:
>   1. Shouldn't there be a note in the docs that explains
>   the behaviour of this method when called from
>   Application.cfm?
>   2. Is expandPath("./") a reliable means of determining
>   the Application.cfm's absolute path? If so, is it
>   cross-platform? If not, what is?

If the value returned by getCurrentTemplatePath() ever changes from
Application.cfm, that's a bug.

The value of GetBaseTemplatePath() should exhibit the behavior you're
saying you're getting from GetCurrentTemplatePath() when called from
within Application.cfm...

However... getCurrentTemplatePath() will provide varried behavior when
it is called within a function -- when called within a function
created using <cffunction> it returns the path to the template
containing the cffunction tag. When called within a function created
using <cfscript> it returns the template in which the function is
called. Personally I think this is insane, but that's the way it is --
I suspect it's intended for CFC's.

You aren't by any chance creating a function which called
getCurrentTemplatePath() and then calling that function? Maybe in a
CFC?

No, expandPath() isn't, has never been and will never be a reliable
means of determining the absolute path to any file Application.cfm or
otherwise, because it expands the path from the base template -- imo
pretty much useless.


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://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/author/?id=4806
http://www.fusiontap.com



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202316
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to