I guess my last post on this was a bit long on detail and parenthetical references, so I'll try to be more clear in case someone does have an answer:
I am writing a web-based template processing service somewhat like Apache::Template, which adds a few configurable behaviors to TT2 to make it act somewhat more like HTML::Mason. Among these are the ability for providers to search the working directory of a template and all its parent directories, up to a specified root directory, similar to how autohandlers and dhandlers are looked for in mason. The main idea here is to make stateful Providers, ones that implement behaviors based on the current state of the system, such as a current working directory, an authentication context, and so forth. Another thing hampering stateful providers is that Documents could once pass unlimited information in when they passed themselves to the Context's visit/leave methods. Now they only pass their blocks list, so I can't even really know which document I'm visiting. So in order to do the current-directory-sensitive behavior, I have had to subclass Template::Context, Template::Provider, and Template::Document (Context keeps a stack of Documents that updates in the visit/leave methods, Provider implements the new search logic, Document remembers its location). I've also had to extend the existing API in incompatible ways, namely reverting visit/leave to an earlier behavior, and passing extra args to Provider::fetch (the latter is compatible -- for now). My question is, is my approach the right one, or am I hacking on the wrong bits here? __________________________________________________ FREE voicemail, email, and fax...all in one place. Sign Up Now! http://www.onebox.com
