| 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 | ▶ | use base qw(Template::Plugin::Filter); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | 1 | ▶ | use vars qw($VERSION); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 1 | $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 | 0 | ▶ | sub filter { |
|
Subroutine
filter: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 47 | 0 | my($self, $text) = @_; | |
| 48 | # do something interesting with $text | ||
| 49 | 0 | return $text; | |
| 50 | } | ||
| 51 | |||
| 52 | 1 | 1; | |
| 53 | |||
| 54 | __END__ | ||