Will Hawes wrote:
I've managed to get it working by nesting stuff like this:
Yep, that's the right way for TT2.
If it does need to be done that way, what is the correct object
hierarchy? As far as I can see, starting from the top it should be
SERVICE -> CONTEXT -> STASH, but I'm not really sure where PARSER and
GRAMMAR fit into that.
That's right so far. Then the provider hangs off the context, the
parser off the provider and the grammar off the parser.
SERVICE -> CONTEXT -+-> STASH
|
+-> PROVIDER -> PARSER -> GRAMMAR
It's a bit complicated, I know.
I think it would be much more convenient if you could just do what the
docs imply, letting TT figure out where everything goes:
Template->new(
SERVICE => My::Service->new(),
CONTEXT => My::Context->new(),
STASH => My::Stash->new()
);
Yes, you're right. That's how it'll work in TT3 (well, not exactly like
that, but close enough).
Cheers
A
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates