On Fri, Jun 07, 2002 at 12:08:04PM +0100, Dave Hodgkinson wrote:
> While you're in a patchy mood, any chance of a clue on the
> Apache::Template issue?
The problem is that the module doesn't create multiple Template objects.
If you have
TT2IncludePath /common
TT2PreProcess config
<Location foo>
TT2IncludePath /foo
TT2PreProcess foostuff
</Location>
<Location bar>
TT2IncludePath /bar
TT2PreProcess barstuff
</Location>
then you should get 3 different template objects, one for the outer
context, another for foo which merges the outer and inner configs,
and another for bar which does the same.
Currently, the SERVER_MERGE and DIR_MERGE correctly merge the arguments
(as far as I know), but I suspect that the Template object that is
created first under whatever particular configuration will be the one
subsequently used for all pages.
The issue is further complicated by the fact that, ideally, the multiple
template objects that should be created should share as many different
components as possible.
For example, the outer context defines an INCLUDE_PATH so a provider
can be created for that and used by the outer template object. The
inner context also defines an INCLUDE_PATH so a second provider should
be created. The template object created in the inner context should
then have 2 providers defined, the outer and the inner. Cached
templates in the outer provider can then be shared across objects.
That's my current understanding of the issue, but I haven't had a chance
to give it the time it deserves. It is still on my TODO list.
A