File Coverage

blib/lib/App/ZofCMS/Output.pm
Criterion Covered Total %
statement 9 34 26.4
branch 0 8 0.0
condition 0 3 0.0
subroutine 3 9 33.3
pod 0 6 0.0
total 12 60 20.0


line stmt bran cond sub pod time code
1              
2             package App::ZofCMS::Output;
3              
4 1     1   542 use strict;
  1         1  
  1         25  
5 1     1   2 use warnings;
  1         2  
  1         15  
6 1     1   3 use Carp;
  1         1  
  1         223  
7              
8             our $VERSION = '1.001006'; # VERSION
9              
10             sub new {
11 0     0 0   my ( $class, $config, $template ) = @_;
12 0           my $self = bless {}, $class;
13 0           $self->config( $config );
14 0           $self->conf( $config->conf );
15 0           $self->template( $template );
16 0           return $self;
17             }
18              
19             sub headers {
20 0     0 0   my $self = shift;
21 0           my $query = $self->config->query;
22 0 0 0       if ( $query->{dir} eq '/' and $query->{page} eq '404' ) {
23 0           return $self->config->cgi->header('text/html','404 Not Found');
24             }
25 0           return $self->config->cgi->header( -type => 'text/html', -charset => 'utf-8' );
26             }
27              
28             sub output {
29 0     0 0   my $self = shift;
30              
31 0           return $self->template->html_template->output;
32             }
33              
34             sub config {
35 0     0 0   my $self = shift;
36 0 0         if ( @_ ) {
37 0           $self->{ config } = shift;
38             }
39 0           return $self->{ config };
40             }
41              
42              
43             sub conf {
44 0     0 0   my $self = shift;
45 0 0         if ( @_ ) {
46 0           $self->{ conf } = shift;
47             }
48 0           return $self->{ conf };
49             }
50              
51              
52             sub template {
53 0     0 0   my $self = shift;
54 0 0         if ( @_ ) {
55 0           $self->{ template } = shift;
56             }
57 0           return $self->{ template };
58             }
59              
60              
61             1;
62             __END__