File Coverage

blib/lib/WE_Frontend/Plugin/Null.pm
Criterion Covered Total %
statement 9 15 60.0
branch n/a
condition n/a
subroutine 3 6 50.0
pod 3 3 100.0
total 15 24 62.5


line stmt bran cond sub pod time code
1             # -*- perl -*-
2              
3             #
4             # $Id: Null.pm,v 1.4 2003/12/16 15:21:23 eserte Exp $
5             # Author: Slaven Rezic
6             #
7             # Copyright (C) 2002 Online Office Berlin. All rights reserved.
8             # Copyright (C) 2002 Slaven Rezic.
9             # This is free software; you can redistribute it and/or modify it under the
10             # terms of the GNU General Public License, see the file COPYING.
11              
12             #
13             # Mail: slaven@rezic.de
14             # WWW: http://we-framework.sourceforge.net
15             #
16              
17             package WE_Frontend::Plugin::Null;
18 1     1   988 use base qw(Template::Plugin);
  1         2  
  1         57  
19              
20 1     1   6 use strict;
  1         2  
  1         28  
21 1     1   5 use vars qw($VERSION);
  1         1  
  1         161  
22             $VERSION = sprintf("%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/);
23              
24             =head1 NAME
25              
26             WE_Frontend::Plugin::Null - null plugin which can print an important sentence
27              
28             =head1 SYNOPSIS
29              
30             my $t = Template->new({PLUGIN_BASE => "WE_Frontend::Plugin"});
31              
32             [% USE Null %]
33             [% Null.helloworld %]
34              
35             =head1 DESCRIPTION
36              
37             This is only a demonstration module for the plugin mechanism.
38              
39             =head2 METHODS
40              
41             =over
42              
43             =cut
44              
45             sub new {
46 0     0 1   my($class, $context) = @_;
47 0           my $self = {Context => $context};
48 0           bless $self, $class;
49             }
50              
51             =item helloworld
52              
53             Return the important sentence.
54              
55             =cut
56              
57             sub helloworld {
58 0     0 1   return "Hello, world!";
59             }
60              
61             =item selfeval("templatevar")
62              
63             Return the value of the named template variable.
64              
65             =cut
66              
67             sub selfeval {
68 0     0 1   my($self, $arg) = @_;
69 0           return $self->{Context}->stash->get($arg);
70             }
71              
72             1;
73              
74             __END__