File Coverage

blib/lib/WE_Frontend/Plugin/NullFilter.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 16 75.0


line stmt bran cond sub pod time code
1             # -*- perl -*-
2              
3             #
4             # $Id: NullFilter.pm,v 1.1 2004/03/25 13:52:43 eserte Exp $
5             # Author: Slaven Rezic
6             #
7             # Copyright (C) 2004 Slaven Rezic.
8             # This is free software; you can redistribute it and/or modify it under the
9             # terms of the GNU General Public License, see the file COPYING.
10              
11             #
12             # Mail: slaven@rezic.de
13             # WWW: http://we-framework.sourceforge.net
14             #
15              
16             package WE_Frontend::Plugin::NullFilter; # <-- change this
17 1     1   1381 use base qw(Template::Plugin::Filter);
  1         3  
  1         117  
18              
19 1     1   6 use strict;
  1         2  
  1         44  
20 1     1   6 use vars qw($VERSION);
  1         2  
  1         131  
21             $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
22              
23             =head1 NAME
24              
25             WE_Frontend::Plugin::NullFilter - a sample custom filter
26              
27             =head1 SYNOPSIS
28              
29             # In the calling script (normally already done by WebEditor::OldController)
30             my $t = Template->new({PLUGIN_BASE => "WE_Frontend::Plugin"});
31              
32             # In the template
33             [% USE NullFilter %]
34             [% FILTER $NullFilter %]
35             ...
36             [% END %]
37             [% variable | $NullFilter %]
38              
39             =head1 DESCRIPTION
40              
41             This filter does nothing, i.e. it copies the input unchanged to the
42             output. This module serves as a sample filter for own extensions.
43              
44             =cut
45              
46             sub filter {
47 0     0 0   my($self, $text) = @_;
48             # do something interesting with $text
49 0           return $text;
50             }
51              
52             1;
53              
54             __END__