Hello,

I have implemented some classes and put one instance of them into the
stash. Something like this:

my $mine = MyClass->new();
my %vars = ( mine => $mine );
my $stash = Template::Stash::XS->new(\%vars);
my $template = Template->new({
   ...
    STASH       => $stash,
}) || die Template->error(), "\n";


Now my question: What is the best way to access the stash inside of a
MyClass method?

I could do something like this
  $mine->set_stash($stash);
so I had it at hand inside of the $mine instance.

But I have the feeling that there could be a better way? Perhaps I have
to derive MyClass from a Template-Toolkit class and had the $context at
hand automatically?

Thanks for any hint,
Gert

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to