]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/Base.pm
added rewrite_path()
[maypole.git] / lib / Maypole / View / Base.pm
index 61c887d3ef0bba3c91922a06ec66de8eb5cecc9c..b577364ada5c80511ecb8e7bda4a3b6ca47de072 100644 (file)
@@ -8,7 +8,7 @@ sub new { bless {}, shift }    # By default, do nothing.
 
 sub paths {
     my ( $self, $r ) = @_;
-    my $root = $r->{config}{template_root} || $r->get_template_root;
+    my $root = $r->config->template_root || $r->get_template_root;
     return (
         $root,
         (
@@ -23,7 +23,7 @@ sub paths {
 sub vars {
     my ( $self, $r ) = @_;
     my $class = $r->model_class;
-    my $base  = $r->{config}->{uri_base};
+    my $base  = $r->config->uri_base;
     $base =~ s/\/+$//;
     my %args = (
         request => $r,
@@ -61,10 +61,10 @@ sub vars {
 
 sub process {
     my ( $self, $r ) = @_;
-    my $status = $self->template($r);
-    return $self->error($r) if $status != OK;
     $r->{content_type}      ||= "text/html";
     $r->{document_encoding} ||= "utf-8";
+    my $status = $self->template($r);
+    return $self->error($r) if $status != OK;
     return OK;
 }