From: Tomas Doran Date: Wed, 10 Mar 2010 20:02:47 +0000 (+0000) Subject: Document setting, make skeleton generate it by default X-Git-Tag: v0.33^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-TT.git;a=commitdiff_plain;h=3715305fd666ffb7f7a116c2bf8854984cd0cfd0 Document setting, make skeleton generate it by default --- diff --git a/Changes b/Changes index 9a23c7c..c997d8d 100644 --- a/Changes +++ b/Changes @@ -4,7 +4,8 @@ Revision history for Perl extension Catalyst::View::TT. returning the exception. To silence the warning, pass 'render_die => 0' to the constructor. Better yet, pass 'render_die => 1' to make it die instead of returning the excption. This will be the default in a - future release. + future release when unspecified. The Helper will generate new views + with render_die => 1. 0.32 2010-02-16 05:55:00 - Various documentation improvements. diff --git a/lib/Catalyst/Helper/View/TT.pm b/lib/Catalyst/Helper/View/TT.pm index 6c9462f..9dc6155 100644 --- a/lib/Catalyst/Helper/View/TT.pm +++ b/lib/Catalyst/Helper/View/TT.pm @@ -55,7 +55,10 @@ use warnings; use base 'Catalyst::View::TT'; -__PACKAGE__->config(TEMPLATE_EXTENSION => '.tt'); +__PACKAGE__->config( + TEMPLATE_EXTENSION => '.tt', + render_die => 1, +); =head1 NAME diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index fd9205b..746d1c6 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -43,6 +43,7 @@ Catalyst::View::TT - Template View Class # Not set by default PRE_PROCESS => 'config/main', WRAPPER => 'site/wrapper', + render_die => 1, # Default for new apps, see render method docs }, ); @@ -554,6 +555,22 @@ to render page fragments like this: my $fragment = $c->forward("View::TT", "render", $template_name, $c->stash->{fragment_data}); +=head3 Backwards compatibility note + +The render method used to just return the Template::Exception object, rather +than just throwing it. This is now deprecated and instead the render method +will throw an exception for new applications. + +This behaviour can be activated (and is activated in the default skeleton +configuration) by using C<< render_die => 1 >>. If you rely on the legacy +behaviour then a warning will be issued. + +To silence this warning, set C<< render_die => 0 >>, but it is recommended +you adjust your code so that it works with C<< render_die => 1 >>. + +In a future release, C<< render_die => 1 >> will become the default if +unspecified. + =head2 template_vars Returns a list of keys/values to be used as the catalyst variables in the