fixed the bugs produced by draven and the_jester ;)
Sebastian Riedel [Sun, 6 Mar 2005 02:57:50 +0000 (02:57 +0000)]
Changes
README
lib/Catalyst/View/TT.pm

diff --git a/Changes b/Changes
index 8f376fe..ef7676a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::View::TT.
 
+0.07  Sat Mar 04 23:00:00 2005
+        - fixed the bugs produced by draven and the_jester ;)
+
 0.06  Fri Mar 04 20:00:00 2005
         - new helper api
 
diff --git a/README b/README
index 9591668..3d9a445 100644 (file)
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ NAME
 
 SYNOPSIS
         # use the helper
-        create view TT TT
+        create.pl view TT TT
 
         # lib/MyApp/View/TT.pm
         package MyApp::View::TT;
@@ -17,9 +17,18 @@ SYNOPSIS
         $c->forward('MyApp::View::TT');
 
 DESCRIPTION
-    This is the "Template" view class.
+    This is the "Template" view class. Your subclass should inherit from
+    this class. If you want to override TT config settings, you can do it
+    there by setting __PACKAGE__->config->{OPTION} as shown in the synopsis.
+    Of interest might be EVAL_PERL, which is disabled by default, and
+    LOAD_TEMPLATES, which is set to use the provider.
 
-  OVERLOADED METHODS
+    If you want to use EVAL perl, add something like this:
+
+        __PACKAGE__->config->{EVAL_PERL} = 1;
+        __PACKAGE__->config->{LOAD_TEMPLATES} = undef;
+
+  METHODS
    process
     Renders the template specified in $c->stash->{template} or
     $c->request->match to $c->response->output.
index e9719ce..0411639 100644 (file)
@@ -1,17 +1,14 @@
 package Catalyst::View::TT;
 
 use strict;
-use base qw/Catalyst::Base Class::Data::Inheritable/;
+use base qw/Catalyst::Base/;
 use Template;
 use Template::Timer;
 use NEXT;
 
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 __PACKAGE__->mk_accessors('template');
-__PACKAGE__->mk_classdata('config');
-
-__PACKAGE__->config( { EVAL_PERL => 0 } );
 
 =head1 NAME
 
@@ -20,7 +17,7 @@ Catalyst::View::TT - Template View Class
 =head1 SYNOPSIS
 
     # use the helper
-    create view TT TT
+    create.pl view TT TT
 
     # lib/MyApp/View/TT.pm
     package MyApp::View::TT;
@@ -46,24 +43,22 @@ If you want to use EVAL perl, add something like this:
     __PACKAGE__->config->{EVAL_PERL} = 1;
     __PACKAGE__->config->{LOAD_TEMPLATES} = undef;
 
-=head2 OVERLOADED METHODS
+=head2 METHODS
 
 =cut
 
 sub new {
-    my $class  = shift;
-    my $c      = shift;
-    my $self   = $class->NEXT::new(@_);
-    our ($template, $provider);
+    my $self = shift;
+    my $c    = shift;
+    $self = $self->NEXT::new(@_);
     my $root   = $c->config->{root};
-    $provider ||= Template::Provider->new();
-    $provider->include_path([ $root, "$root/base" ]);
-    my %config= ( LOAD_TEMPLATES => [ $provider ],
-                  %{ $class->config() },
-                  INCLUDE_PATH => [ $root, "$root/base" ]
-                );
+    my %config = (
+        EVAL_PERL    => 0,
+        INCLUDE_PATH => [ $root, "$root/base" ],
+        %{ $class->config() }
+    );
     $config{CONTEXT} = Template::Timer->new(%config) if $c->debug;
-    $self->template( Template->new(\%config));
+    $self->template( Template->new( \%config ) );
     return $self;
 }