X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FTT.pm;h=f4d5762cf4164485d0566222b35936e06a6f0c10;hb=fe3df9dcf23365f7d3e685d128042393703a3ad7;hp=6a801f432ab1b723e6e6712f7ce247bf933a295f;hpb=6272875535815cff02a26cd3c57d41502e15cff4;p=catagits%2FCatalyst-View-TT.git diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index 6a801f4..f4d5762 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -1,14 +1,23 @@ package Catalyst::View::TT; use strict; -use base qw/Catalyst::Base/; +use warnings; + +use base qw/Catalyst::View/; +use Data::Dump 'dump'; use Template; use Template::Timer; -use NEXT; +use MRO::Compat; +use Scalar::Util qw/blessed weaken/; -our $VERSION = '0.07'; +our $VERSION = '0.38'; +$VERSION = eval $VERSION; __PACKAGE__->mk_accessors('template'); +__PACKAGE__->mk_accessors('expose_methods'); +__PACKAGE__->mk_accessors('include_path'); + +*paths = \&include_path; =head1 NAME @@ -16,116 +25,757 @@ Catalyst::View::TT - Template View Class =head1 SYNOPSIS - # use the helper - create.pl view TT TT +# use the helper to create your View - # lib/MyApp/View/TT.pm - package MyApp::View::TT; + myapp_create.pl view Web TT - use base 'Catalyst::View::TT'; +# add custom configration in View/Web.pm - __PACKAGE__->config->{DEBUG} = 'all'; + __PACKAGE__->config( + # any TT configuration items go here + TEMPLATE_EXTENSION => '.tt', + CATALYST_VAR => 'c', + TIMER => 0, + ENCODING => 'utf-8' + # Not set by default + PRE_PROCESS => 'config/main', + WRAPPER => 'site/wrapper', + render_die => 1, # Default for new apps, see render method docs + expose_methods => [qw/method_in_view_class/], + ); - 1; - - $c->forward('MyApp::View::TT'); +# add include path configuration in MyApp.pm -=head1 DESCRIPTION + __PACKAGE__->config( + 'View::Web' => { + INCLUDE_PATH => [ + __PACKAGE__->path_to( 'root', 'src' ), + __PACKAGE__->path_to( 'root', 'lib' ), + ], + }, + ); -This is the C