App-ZofCMS
view release on metacpan or search on metacpan
lib/App/ZofCMS/Output.pm view on Meta::CPAN
package App::ZofCMS::Output;
use strict;
use warnings;
use Carp;
our $VERSION = '1.001008'; # VERSION
sub new {
my ( $class, $config, $template ) = @_;
my $self = bless {}, $class;
$self->config( $config );
$self->conf( $config->conf );
$self->template( $template );
return $self;
}
sub headers {
my $self = shift;
my $query = $self->config->query;
if ( $query->{dir} eq '/' and $query->{page} eq '404' ) {
return $self->config->cgi->header('text/html','404 Not Found');
}
return $self->config->cgi->header( -type => 'text/html', -charset => 'utf-8' );
}
sub output {
my $self = shift;
return $self->template->html_template->output;
}
sub config {
my $self = shift;
if ( @_ ) {
$self->{ config } = shift;
}
return $self->{ config };
}
sub conf {
my $self = shift;
if ( @_ ) {
$self->{ conf } = shift;
}
return $self->{ conf };
}
sub template {
my $self = shift;
if ( @_ ) {
$self->{ template } = shift;
}
return $self->{ template };
}
1;
__END__
=encoding utf8
=head1 NAME
App::ZofCMS::Output - "core" part of ZofCMS - web-framework/templating system
=head1 SYNOPSIS
N/A
=head1 DESCRIPTION
This module is used internally by L<App::ZofCMS> and currently does not
provide anything "public".
=head1 REPOSITORY
Fork this module on GitHub:
L<https://github.com/zoffixznet/App-ZofCMS>
( run in 0.949 second using v1.01-cache-2.11-cpan-39bf76dae61 )