X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FTT.pm;h=21e2485b794a7d3a3fe6f5b694b4aa58a7b1de14;hb=13c3c3ffef691cfc461e88ac9a9e6cef65a15a8f;hp=0e8d89fbc1b2476f992c7aee9c57a1f7eafd3ea3;hpb=49b0368ba6c1d3d0bd1418a5914bc5265a22941f;p=maypole.git diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index 0e8d89f..21e2485 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -4,13 +4,14 @@ 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 OK; - } else { + } + else { $r->{error} = $template->error; return ERROR; } @@ -24,7 +25,7 @@ Maypole::View::TT - A Template Toolkit view class for Maypole =head1 SYNOPSIS - BeerDB->config->{view} = "Maypole::View::TT"; # The default anyway + BeerDB->config->view("Maypole::View::TT"); # The default anyway =head1 DESCRIPTION @@ -34,8 +35,19 @@ Please see the Maypole manual, and in particular, the C chapter, 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 + +=back + + =head1 AUTHOR Simon Cozens =cut +