[Catalyst-commits] r13039 - in Catalyst-View-TT/branches/render_die: . lib/Catalyst/Helper/View lib/Catalyst/View

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Wed Mar 10 20:02:47 GMT 2010


Author: t0m
Date: 2010-03-10 20:02:47 +0000 (Wed, 10 Mar 2010)
New Revision: 13039

Modified:
   Catalyst-View-TT/branches/render_die/Changes
   Catalyst-View-TT/branches/render_die/lib/Catalyst/Helper/View/TT.pm
   Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm
Log:
Document setting, make skeleton generate it by default

Modified: Catalyst-View-TT/branches/render_die/Changes
===================================================================
--- Catalyst-View-TT/branches/render_die/Changes	2010-03-10 18:24:49 UTC (rev 13038)
+++ Catalyst-View-TT/branches/render_die/Changes	2010-03-10 20:02:47 UTC (rev 13039)
@@ -4,7 +4,8 @@
           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.

Modified: Catalyst-View-TT/branches/render_die/lib/Catalyst/Helper/View/TT.pm
===================================================================
--- Catalyst-View-TT/branches/render_die/lib/Catalyst/Helper/View/TT.pm	2010-03-10 18:24:49 UTC (rev 13038)
+++ Catalyst-View-TT/branches/render_die/lib/Catalyst/Helper/View/TT.pm	2010-03-10 20:02:47 UTC (rev 13039)
@@ -55,7 +55,10 @@
 
 use base 'Catalyst::View::TT';
 
-__PACKAGE__->config(TEMPLATE_EXTENSION => '.tt');
+__PACKAGE__->config(
+    TEMPLATE_EXTENSION => '.tt',
+    render_die => 1,
+);
 
 =head1 NAME
 

Modified: Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm
===================================================================
--- Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm	2010-03-10 18:24:49 UTC (rev 13038)
+++ Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm	2010-03-10 20:02:47 UTC (rev 13039)
@@ -43,6 +43,7 @@
             # 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 @@
 
     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




More information about the Catalyst-commits mailing list