App::ZofCMS::Output - "core" part of ZofCMS - web-framework/templating system


App-ZofCMS documentation Contained in the App-ZofCMS distribution.

Index


Code Index:

NAME

Top

App::ZofCMS::Output - "core" part of ZofCMS - web-framework/templating system

SYNOPSYS

Top

N/A

DESCRIPTION

Top

This module is used internally by App::ZofCMS and currently does not provide anything "public".

AUTHOR

Top

Zoffix Znet, <zoffix at cpan.org> (http://zoffix.com, http://haslayout.net)

BUGS

Top

Please report any bugs or feature requests to bug-app-zofcms at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-ZofCMS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc App::ZofCMS

You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-ZofCMS

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/App-ZofCMS

* CPAN Ratings

http://cpanratings.perl.org/d/App-ZofCMS

* Search CPAN

http://search.cpan.org/dist/App-ZofCMS

COPYRIGHT & LICENSE

Top


App-ZofCMS documentation Contained in the App-ZofCMS distribution.

package App::ZofCMS::Output;

use strict;
use warnings;
use Carp;

our $VERSION = '0.0221';

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__