RE: Get path of page calling cfinvoke?
I have had times when I wanted to get the calling template of a given template (for debugging purposes). I haven't ever actually used it, but I think Raymond Camden came up with something that might help you figure out the stack trace and therefore the list of templates being called: http://ray.camdenfamily.com/index.cfm/2005/10/4/CFC-Debugging -ben ... Ben Nadel Web Developer Nylon Technology 6 West 14th Street New York, NY 10011 212.691.1134 212.691.3477 fax www.nylontechnology.com "Vote for Pedro" -Original Message- From: Sam Farmer [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 11:38 AM To: CF-Talk Subject: Re: Get path of page calling cfinvoke? GetCurrentTemplatePath() might get you what you want. But Barney's second paragraph hits the nail on the head. CFC's should never need this type of information (except _perhaps_ for logging?? and if you needed that). Cheers, Sam F On 11/28/05, Barney Boisvert <[EMAIL PROTECTED]> wrote: > You could thow an exception and examine the stack trace, but that > won't help for inherited methods, only for inherited methods called > from methods defined in the subclass. > > Of course, if your functionality is dependant on knowing who's calling > you, you likely have some flaw in your design. Environment > non-neutrality is a pretty consistent warning flag for "bad things". > In particular, an object should never know or care what it's > subclasses are. > > cheers, > banreyb > ~| 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:225569 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
Re: Get path of page calling cfinvoke?
GetCurrentTemplatePath() might get you what you want. But Barney's second paragraph hits the nail on the head. CFC's should never need this type of information (except _perhaps_ for logging?? and if you needed that). Cheers, Sam F On 11/28/05, Barney Boisvert <[EMAIL PROTECTED]> wrote: > You could thow an exception and examine the stack trace, but that > won't help for inherited methods, only for inherited methods called > from methods defined in the subclass. > > Of course, if your functionality is dependant on knowing who's calling > you, you likely have some flaw in your design. Environment > non-neutrality is a pretty consistent warning flag for "bad things". > In particular, an object should never know or care what it's > subclasses are. > > cheers, > banreyb > ~| 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:225566 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
Re: Get path of page calling cfinvoke?
You could thow an exception and examine the stack trace, but that won't help for inherited methods, only for inherited methods called from methods defined in the subclass. Of course, if your functionality is dependant on knowing who's calling you, you likely have some flaw in your design. Environment non-neutrality is a pretty consistent warning flag for "bad things". In particular, an object should never know or care what it's subclasses are. cheers, banreyb On 11/28/05, Andrew Spear <[EMAIL PROTECTED]> wrote: > Is it possible for a CFC to determine the path of the physical template that > is cfinvoking it? I'm trying to have a base CFC determine what file is > extending it. Any ideas? > > Thanks- > Andrew > > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ~| 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:225494 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