> 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. ... > 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).
You did all of that just to get TT to climb the directory tree when resolving template calls? Why don't you just vary the include path on each request? TT already knows how to climb the include path. - Perrin
