From: Tomas Doran Date: Thu, 12 Nov 2009 00:32:30 +0000 (+0000) Subject: Merge miscommit from other branch: svn merge -r 11796:11797 http://dev.catalyst.perl... X-Git-Tag: v0.32~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-TT.git;a=commitdiff_plain;h=2844488fd64b15248c01c25d3202a4a81851bfba Merge miscommit from other branch: svn merge -r 11796:11797 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) --- diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index d07faba..8cb0cf0 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -303,6 +303,38 @@ to the TT view class. $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's C<< $c->view >> method +for details. + +=item * + +<< $c->res->redirect >> is handled by default. If you just forward to +C in your C routine, you could break this by sending additional +content. + +=back + +See L for more details. + =head2 CONFIGURATION There are a three different ways to configure your view class. The