[Templates] Testing plugins
darren chamberlain
dlc@users.sourceforge.net
Fri, 8 Nov 2002 15:36:22 -0500
* Simon Wilcox <essuu@ourshack.com> [2002-11-05 07:01]:
> So I've used the Template::Plugin::Filter module as the base class and
> written my code but when I try to test it I get the following error:
>
> undef error - FilterImg: filter not found at t/1.t line 32.
>
> That's coming from TT as it fails to load the filter but it is already
> loaded. What am I doing wrong ?
I don't remember if anyone responded, but I think the problem is...
> my $imgroot = `pwd`;
> chomp $imgroot;
>
> my $t = Template->new();
>
> my $tmpl = <<END;
> [% USE FilterImg("$imgroot") %]
> [% FILTER FilterImg %]
[% FILTER $FilterImg %]
> <img src="/t/test1.gif" />
> [% END %]
> END
Template::Plugin::Filter subclasses need to be referenced when used as
filters.
(darren)
--
Any philosophy that can be put in a nutshell belongs there.
-- Sydney J. Harris