Re: [Templates] Creating Wiki-style Free links?

[prev] [thread] [next] [Date index for 2004/09/01]

From: Simon Wilcox
Subject: Re: [Templates] Creating Wiki-style Free links?
Date: 13:41 on 01 Sep 2004
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

[Templates] Creating Wiki-style Free links?
Jesse Sheidlower 13:05 on 01 Sep 2004

Re: [Templates] Creating Wiki-style Free links?
Simon Wistow 13:38 on 01 Sep 2004

Re: [Templates] Creating Wiki-style Free links?
Simon Wilcox 13:41 on 01 Sep 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52