[Catalyst-commits] r12544 - Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual

dandv at dev.catalyst.perl.org dandv at dev.catalyst.perl.org
Thu Jan 7 22:23:22 GMT 2010


Author: dandv
Date: 2010-01-07 22:23:22 +0000 (Thu, 07 Jan 2010)
New Revision: 12544

Modified:
   Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Cookbook.pod
Log:
Moved 'Extending RenderView' at the end of the Controllers section, and let 'Action Types' be at the start

Modified: Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Cookbook.pod
===================================================================
--- Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Cookbook.pod	2010-01-07 22:06:51 UTC (rev 12543)
+++ Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Cookbook.pod	2010-01-07 22:23:22 UTC (rev 12544)
@@ -1084,36 +1084,6 @@
 Controllers are the main point of communication between the web server
 and your application.  Here we explore some aspects of how they work.
 
-=head2 Extending RenderView (formerly DefaultEnd)
-
-The recommended approach for an C<end> action is to use
-L<Catalyst::Action::RenderView> (taking the place of
-L<Catalyst::Plugin::DefaultEnd>), which does what you usually need.
-However there are times when you need to add a bit to it, but don't want
-to write your own C<end> action.
-
-You can extend it like this:
-
-To add something to an C<end> action that is called before rendering
-(this is likely to be what you want), simply place it in the C<end>
-method:
-
-    sub end : ActionClass('RenderView') {
-      my ( $self, $c ) = @_;
-      # do stuff here; the RenderView action is called afterwards
-    }
-
-To add things to an C<end> action that are called I<after> rendering,
-you can set it up like this:
-
-    sub render : ActionClass('RenderView') { }
-
-    sub end : Private {
-      my ( $self, $c ) = @_;
-      $c->forward('render');
-      # do stuff here
-    }
-
 =head2 Action Types
 
 =head3 Introduction
@@ -1510,7 +1480,39 @@
   use base qw/Catalyst::Controller/;
 
   sub key1 : Chained('/')
+  
+=head2 Extending RenderView (formerly DefaultEnd)
 
+The recommended approach for an C<end> action is to use
+L<Catalyst::Action::RenderView> (taking the place of
+L<Catalyst::Plugin::DefaultEnd>), which does what you usually need.
+However there are times when you need to add a bit to it, but don't want
+to write your own C<end> action.
+
+You can extend it like this:
+
+To add something to an C<end> action that is called before rendering
+(this is likely to be what you want), simply place it in the C<end>
+method:
+
+    sub end : ActionClass('RenderView') {
+      my ( $self, $c ) = @_;
+      # do stuff here; the RenderView action is called afterwards
+    }
+
+To add things to an C<end> action that are called I<after> rendering,
+you can set it up like this:
+
+    sub render : ActionClass('RenderView') { }
+
+    sub end : Private {
+      my ( $self, $c ) = @_;
+      $c->forward('render');
+      # do stuff here
+    }
+
+  
+
 =head1 Deployment
 
 The recipes below describe aspects of the deployment process,




More information about the Catalyst-commits mailing list