View::TT, added tests from dwc
[catagits/Catalyst-View-TT.git] / lib / Catalyst / View / TT.pm
index 2e54829..6b7a828 100644 (file)
@@ -6,7 +6,7 @@ use Template;
 use Template::Timer;
 use NEXT;
 
-our $VERSION = '0.15';
+our $VERSION = '0.20';
 
 __PACKAGE__->mk_accessors('template');
 
@@ -27,12 +27,12 @@ Catalyst::View::TT - Template View Class
         'V::TT' => {
             # any TT configurations items go here
             INCLUDE_PATH => [
-              MyApp->path_to( 'root', 'templates', 'src' ), 
-              MyApp->path_to( 'root', 'templates', 'lib' ), 
+              MyApp->path_to( 'root', 'src' ), 
+              MyApp->path_to( 'root', 'lib' ), 
             ],
-            PRE_PROCESS => 'config/main',
-            WRAPPER     => 'site/wrapper',
-           TEMPLATE_SUFFIX => '.tt',
+            PRE_PROCESS        => 'config/main',
+            WRAPPER            => 'site/wrapper',
+            TEMPLATE_EXTENSION => '.tt',
 
             # two optional config items
             CATALYST_VAR => 'Catalyst',
@@ -255,7 +255,7 @@ sub new {
         $c->log->debug( "TT Config: ", Dumper($config) );
     }
 
-    return $class->NEXT::new(
+    my $self = $class->NEXT::new(
         $c,
         {
             template => Template->new($config) || do {
@@ -263,9 +263,13 @@ sub new {
                 $c->log->error($error);
                 $c->error($error);
                 return undef;
-              }
-        }
+              },
+        %{$config},
+        },
     );
+    $self->config($config);
+
+    return $self;
 }
 
 =item process
@@ -370,7 +374,7 @@ output from your templates, such as:
     <!-- TIMER END: process mainmenu/footer.tt (0.003016 seconds) -->
 
 
-=item C<TEMPLATE_SUFFIX>
+=item C<TEMPLATE_EXTENSION>
 
 a sufix to add when looking for templates bases on the C<match> method in L<Catalyst::Request>.