fixed constructor to use passed $args
Christian Hansen [Mon, 11 Jul 2005 18:24:43 +0000 (18:24 +0000)]
Changes
lib/Catalyst/View/TT.pm

diff --git a/Changes b/Changes
index bbe054d..47901cd 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::View::TT.
 
+0.12  Xxx Xxx 00 00:00:00 2005
+        - Fixed constructor
+
 0.12  Web Jul 06 15:24:00 2005
         - Fixed, don't set Content-Type on failure
         - Fixed helper to use [%author%]
index b57d180..c66a8e2 100644 (file)
@@ -6,7 +6,7 @@ use Template;
 use Template::Timer;
 use NEXT;
 
-our $VERSION = '0.12';
+our $VERSION = '0.13';
 
 __PACKAGE__->mk_accessors('template');
 
@@ -94,22 +94,22 @@ and reads the application config.
 =cut
 
 sub new {
-    my $self = shift;
-    my $c    = shift;
-    $self = $self->NEXT::new(@_);
-    my $root   = $c->config->{root};
+    my ( $class, $c, $arguments ) = @_;
+
+    my $root = $c->config->{root};
+
     my %config = (
         EVAL_PERL    => 0,
         INCLUDE_PATH => [ $root, "$root/base" ],
-        %{ $self->config() }
+        %{ $class->config },
+        %{ $arguments }
     );
 
     if ( $c->debug && not exists $config{CONTEXT} ) {
        $config{CONTEXT} = Template::Timer->new(%config);
     }
 
-    $self->template( Template->new( \%config ) );
-    return $self;
+    return $class->NEXT::new( $c, { template => Template->new( \%config ) } );
 }
 
 =item process