]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/TT.pm
Added Maypole::Config, and changed other classes to reflect that.
[maypole.git] / lib / Maypole / View / TT.pm
index 15581e8a78cb1a40f2270952c14736391648dd54..9a15dfa7044f384490b9f4d30a9f1262fa91897f 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
 
@@ -38,3 +40,4 @@ components are resolved.
 Simon Cozens
 
 =cut
+