package Maypole::View::TT;
use base 'Maypole::View::Base';
+use Maypole::Constants;
use Template;
sub template {
- my ($self, $r) = @_;
- my $template = Template->new({ INCLUDE_PATH => [ $self->paths($r) ]});
+ my ( $self, $r ) = @_;
+ my $template = Template->new( { INCLUDE_PATH => [ $self->paths($r) ] } );
my $output;
- if ($template->process($r->template, { $self->vars($r) }, \$output)) {
+ if ( $template->process( $r->template, { $self->vars($r) }, \$output ) ) {
$r->{output} = $output;
- return 1;
- } else {
+ return OK;
+ }
+ else {
$r->{error} = $template->error;
- return 0;
+ return ERROR;
}
}
=head1 SYNOPSIS
- BeerDB->config->{view} = "Maypole::View::TT"; # The default anyway
+ BeerDB->config->view("Maypole::View::TT"); # The default anyway
=head1 DESCRIPTION
for the template variables available and for a refresher on how template
components are resolved.
+=over 4
+
+=item template
+
+
+Processes the template and sets the output. See L<Maypole::View::Base>
+
+=back
+
+
=head1 AUTHOR
Simon Cozens
=cut
+