X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FView%2FTT.pm;h=45fd5e428c8e8b4a3ea8b4b90b6014df6b1c56df;hb=58417aa5f41b42076f991a81b403633bfcb94f39;hp=c79c027633f23ae55623b10eda75cd0c1dbb32ca;hpb=628ecd5d9d294e601c79c7509140d02dcd7a1d40;p=maypole.git diff --git a/lib/Maypole/View/TT.pm b/lib/Maypole/View/TT.pm index c79c027..45fd5e4 100644 --- a/lib/Maypole/View/TT.pm +++ b/lib/Maypole/View/TT.pm @@ -21,13 +21,17 @@ sub template { $self->{provider}->include_path([ $self->paths($r) ]); + my $template_file = $r->template; + my $ext = $r->config->template_extension; + $template_file .= $ext if defined $ext; + my $output; - if ($self->{tt}->process( $r->template, { $self->vars($r) }, \$output )) { + if ($self->{tt}->process($template_file, { $self->vars($r) }, \$output )) { $r->{output} = $output; return OK; } else { - $r->{error} = $self->{tt}->error; + $r->{error} = "TT error for template '$template_file'\n" . $self->{tt}->error; return ERROR; } } @@ -52,9 +56,9 @@ Maypole::View::TT - A Template Toolkit view class for Maypole This is the default view class for Maypole; it uses the Template Toolkit to fill in templates with the objects produced by Maypole's model classes. Please -see the Maypole manual, and in particular, the L -chapter for the template variables available and for a refresher on how -template components are resolved. +see the L, and in particular, the +L chapter for the template variables available and +for a refresher on how template components are resolved. The underlying Template toolkit object is configured through C<$r-Econfig-Eview_options>. See L for available