]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/TT.pm
New Maypole::Application, we now use the Maypole::Plugin:: namespace and
[maypole.git] / lib / Maypole / View / TT.pm
index 15581e8a78cb1a40f2270952c14736391648dd54..21e2485b794a7d3a3fe6f5b694b4aa58a7b1de14 100644 (file)
@@ -1,17 +1,19 @@
 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;
     }
 }
 
@@ -23,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
 
@@ -33,8 +35,19 @@ Please see the Maypole manual, and in particular, the C<View> 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<Maypole::View::Base>
+
+=back
+
+
 =head1 AUTHOR
 
 Simon Cozens
 
 =cut
+