From: Andrew Rodland Date: Thu, 8 Jul 2010 23:21:47 +0000 (+0000) Subject: Try to straighten out the View::TT docs X-Git-Tag: v0.35~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=226c1dd33479e2c231b70634ce32b99bb2939446;p=catagits%2FCatalyst-View-TT.git Try to straighten out the View::TT docs --- diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index 58b2476..dc3307d 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -25,28 +25,23 @@ Catalyst::View::TT - Template View Class # use the helper to create your View - myapp_create.pl view TT TT + myapp_create.pl view Web TT -# configure in lib/MyApp.pm (Could be set from configfile instead) +# add custom configration in View/Web.pm __PACKAGE__->config( - name => 'MyApp', - root => MyApp->path_to('root'), - default_view => 'TT', - 'View::TT' => { - # any TT configurations items go here - INCLUDE_PATH => [ - MyApp->path_to( 'root', 'src' ), - MyApp->path_to( 'root', 'lib' ), - ], - TEMPLATE_EXTENSION => '.tt', - CATALYST_VAR => 'c', - TIMER => 0, - # Not set by default - PRE_PROCESS => 'config/main', - WRAPPER => 'site/wrapper', - render_die => 1, # Default for new apps, see render method docs - }, + # any TT configuration items go here + INCLUDE_PATH => [ + MyApp->path_to( 'root', 'src' ), + MyApp->path_to( 'root', 'lib' ), + ], + TEMPLATE_EXTENSION => '.tt', + CATALYST_VAR => 'c', + TIMER => 0, + # Not set by default + PRE_PROCESS => 'config/main', + WRAPPER => 'site/wrapper', + render_die => 1, # Default for new apps, see render method docs ); # render view from lib/MyApp.pm or lib/MyApp::Controller::SomeController.pm @@ -55,7 +50,7 @@ Catalyst::View::TT - Template View Class my ( $self, $c ) = @_; $c->stash->{template} = 'message.tt2'; $c->stash->{message} = 'Hello World!'; - $c->forward( $c->view('TT') ); + $c->forward( $c->view('Web') ); } # access variables from template @@ -287,18 +282,20 @@ __END__ This is the Catalyst view class for the L