[Catalyst-commits] r12910 - in
Catalyst-View-TT/branches/render_die: . lib/Catalyst/View
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Feb 16 22:23:03 GMT 2010
Author: t0m
Date: 2010-02-16 22:23:03 +0000 (Tue, 16 Feb 2010)
New Revision: 12910
Modified:
Catalyst-View-TT/branches/render_die/
Catalyst-View-TT/branches/render_die/Changes
Catalyst-View-TT/branches/render_die/Makefile.PL
Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm
Log:
r11835 at t0mlaptop (orig r11800): t0m | 2009-11-12 00:32:30 +0000
Merge miscommit from other branch: svn merge -r 11796:11797 http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-View-TT/branches/render_die
Original commit:
Author: osfameron
Date: 2009-11-11 10:58:24 +0000 (Wed, 11 Nov 2009)
New Revision: 11797
Modified:
Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm
Log:
Clarify docs for 'sub end' to promote RenderView
(Previously, the docs suggested doing something that would break
->res->redirect)
r12651 at t0mlaptop (orig r12616): t0m | 2010-01-12 02:02:15 +0000
Show config setting as a method call rather than a hask assignment
r12932 at t0mlaptop (orig r12896): rafl | 2010-02-16 04:41:34 +0000
Fix repo url.
r12933 at t0mlaptop (orig r12897): rafl | 2010-02-16 04:47:19 +0000
Version 0.32.
Property changes on: Catalyst-View-TT/branches/render_die
___________________________________________________________________
Name: svk:merge
+ 4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-View-TT/trunk:12897
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-View-TT:10559
Modified: Catalyst-View-TT/branches/render_die/Changes
===================================================================
--- Catalyst-View-TT/branches/render_die/Changes 2010-02-16 21:58:42 UTC (rev 12909)
+++ Catalyst-View-TT/branches/render_die/Changes 2010-02-16 22:23:03 UTC (rev 12910)
@@ -1,9 +1,12 @@
Revision history for Perl extension Catalyst::View::TT.
-0.32
- The "render()" method now dies on exception, rather than returning
the exception object.
+0.32 2010-02-16 05:55:00
+ - Various documentation improvements.
+ - Fix repository metadata.
+
0.31 2009-10-29 19:26:00
- Moved the test actions to their own controller file to silence
warning about actions in the app class being deprecated.
Modified: Catalyst-View-TT/branches/render_die/Makefile.PL
===================================================================
--- Catalyst-View-TT/branches/render_die/Makefile.PL 2010-02-16 21:58:42 UTC (rev 12909)
+++ Catalyst-View-TT/branches/render_die/Makefile.PL 2010-02-16 22:23:03 UTC (rev 12910)
@@ -19,6 +19,6 @@
test_requires 'Test::More';
auto_install;
-resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-View-TT/';
+resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-View-TT/';
WriteAll;
Modified: Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm
===================================================================
--- Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm 2010-02-16 21:58:42 UTC (rev 12909)
+++ Catalyst-View-TT/branches/render_die/lib/Catalyst/View/TT.pm 2010-02-16 22:23:03 UTC (rev 12910)
@@ -9,7 +9,7 @@
use Template::Timer;
use MRO::Compat;
-our $VERSION = '0.31';
+our $VERSION = '0.32';
__PACKAGE__->mk_accessors('template');
__PACKAGE__->mk_accessors('include_path');
@@ -286,7 +286,7 @@
use base 'Catalyst::View::TT';
- __PACKAGE__->config->{DEBUG} = 'all';
+ __PACKAGE__->config(DEBUG => 'all');
Now you can modify your action handlers in the main application and/or
controllers to forward to your view class. You might choose to do this
@@ -300,6 +300,38 @@
$c->forward( $c->view('TT') );
}
+But if you are using the standard auto-generated end action, you don't even need
+to do this!
+
+ # in MyApp::Controller::Root
+ sub end : ActionClass('RenderView') {} # no need to change this line
+
+ # in MyApp.pm
+ __PACKAGE__->config(
+ ...
+ default_view => 'TT',
+ );
+
+This will Just Work. And it has the advantages that:
+
+=over 4
+
+=item *
+
+If you want to use a different view for a given request, just set
+<< $c->stash->{current_view} >>. (See L<Catalyst>'s C<< $c->view >> method
+for details.
+
+=item *
+
+<< $c->res->redirect >> is handled by default. If you just forward to
+C<View::TT> in your C<end> routine, you could break this by sending additional
+content.
+
+=back
+
+See L<Catalyst::Action::RenderView> for more details.
+
=head2 CONFIGURATION
There are a three different ways to configure your view class. The
More information about the Catalyst-commits
mailing list