ASP4/FormHandler.pm untested

filter: Statementstmt 0.0% 0 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 16 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package ASP4::FormHandler;
3  
4 use strict;
5 use warnings 'all';
6 use base 'ASP4::HTTPHandler';
7 use vars __PACKAGE__->VARS;
8  
9 1;# return true:
10  
11 =pod
12  
13 =head1 NAME
14  
15 ASP4::FormHandler - Base class for all form handlers
16  
17 =head1 SYNOPSIS
18  
19 package my::handler;
20
21 use strict;
22 use warnings 'all';
23 use base 'ASP4::FormHandler';
24
25 # Import $Request, $Response, $Session, $Server, $Form, $Config, $Stash
26 use vars __PACKAGE__->VARS;
27
28 sub run {
29 my ($self, $context) = @_;
30
31 $Response->Write("Hello, World!");
32 }
33
34 1;# return true:
35  
36 =head1 DESCRIPTION
37  
38 All ASP4 *.asp scripts and C</handlers/*> classes should inherit from C<ASP4::FormHandler>.
39  
40 =head1 PROPERTIES
41  
42 =head2 VARS
43  
44 Returns the list of variable names of the ASP4 intrinsic objects.
45  
46 $Request $Response
47 $Session $Server
48 $Config $Form
49 $Stash
50  
51 =head1 METHODS
52  
53 =head2 before_run( $self, $context )
54  
55 Called before C<run> - can be used to deny access or redirect elsewhere under
56 special conditions.
57  
58 =head2 run( $self, $context )
59  
60 Where most of your action is expected to occur.
61  
62 =head2 after_run( $self, $context )
63  
64 Called after C<run>, can be used
65  
66 =cut
67