WE_Frontend/Plugin/Null.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 65.3% 17 / 26 CC 1 SCAR 4.1
CC
1
Cov
65%
new
2.0
helloworld
2.0
selfeval
2.0
CRAP 1.5
« WE/DB/HWContent.pm ↑ Summary WE/Obj/DocObj.pm »
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 ▶use base qw(Template::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 $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 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
46 0 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 0 ▶sub helloworld {
Subroutine helloworld: not called CC=1 SCAR=6.9
Pod documented
58 0 return "Hello, world!";
59 }
60  
61 =item selfeval("templatevar")
62  
63 Return the value of the named template variable.
64  
65 =cut
66  
67 0 ▶sub selfeval {
Subroutine selfeval: not called CC=1 SCAR=6.9
Pod documented
68 0 my($self, $arg) = @_;
69 0 return $self->{Context}->stash->get($arg);
70 }
71  
72 1 1;
73  
74 __END__
« WE/DB/HWContent.pm ↑ Summary WE/Obj/DocObj.pm »