Re: [Templates] Creating Wiki-style Free links?
[prev]
[thread]
[next]
[Date index for 2004/09/01]
On Wed, 1 Sep 2004, Jesse Sheidlower wrote:
> I was originally going to write it as a filter, but realized that I
> need to access some TT variables, which determine the path and action,
> and it would be clunky to pass every possible variable into the filter.
> But I'm not sure how to write it as a TT macro, because it seems like
> it would be a difficult with the existing regex-type things in TT.
If you subclass Template::Plugin::Filter [1], you should be able to
retrieve the context object using
my $context = $self->{ _CONTEXT };
from within your filter or init method. From there you can get access to
the stash and all the current variables. See man Template::Stash for more
on that.
HTH,
Simon.
[1]
http://search.cpan.org/~abw/Template-Toolkit-2.13/lib/Template/Plugin/Filter.pm
--
"Fiiiive Gooooold Riiings!"
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
Re: [Templates] Creating Wiki-style Free links?
Simon Wilcox 13:41 on 01 Sep 2004
|