From: Christian Hansen Date: Mon, 11 Jul 2005 18:24:43 +0000 (+0000) Subject: fixed constructor to use passed $args X-Git-Tag: v0.13~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9300af5b2141fe8d2eca26f52b13fa59e11ef6e0;p=catagits%2FCatalyst-View-TT.git fixed constructor to use passed $args --- diff --git a/Changes b/Changes index bbe054d..47901cd 100644 --- 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%] diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index b57d180..c66a8e2 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -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