Document setting, make skeleton generate it by default
Tomas Doran [Wed, 10 Mar 2010 20:02:47 +0000 (20:02 +0000)]
Changes
lib/Catalyst/Helper/View/TT.pm
lib/Catalyst/View/TT.pm

diff --git a/Changes b/Changes
index 9a23c7c..c997d8d 100644 (file)
--- 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.
index 6c9462f..9dc6155 100644 (file)
@@ -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
 
index fd9205b..746d1c6 100644 (file)
@@ -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