X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FCookbook.pod;h=8cd1668e152ed7a82a5e12197921cf3fcd0a6d47;hp=c5aed3c7bf6fb8356f879c9aa10dd0f9261f95b9;hb=a74c2d1a1e12c43e5dbb4caef23f7cc25e57bd1f;hpb=41d5da66615f17db3919de6e5d2a20e3b832af37 diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index c5aed3c..8cd1668 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -30,7 +30,8 @@ condition in the C action. For example: Then just add to your query string C<&dump_info=1> (or if there's no query string for the request, add C to the end of the URL) to force debug output. This feature is included in -L. +L (formerly +L). =head2 Disable statistics @@ -764,28 +765,35 @@ This will let all files within root/static be handled directly by Apache. In a two-tiered setup, the frontend server should handle static files. The configuration to do this on the frontend will vary. -=head2 Extending DefaultEnd +=head2 Extending RenderView (formerly DefaultEnd) -Most people use L as their -end action; it 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 action. +The recommended approach for an C action is to use +L (taking the place of +L), 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 action. -Simply extend it like this: +You can extend it like this: - use Catalyst qw/DefaultEnd/; +To add something to an C action that is called before rendering +(this is likely to be what you want), simply place it in the C +method: - # (time passes) - - sub end : Private { + sub end : ActionClass('RenderView') { my ( $self, $c ) = @_; + # do stuff here; the RenderView action is called afterwards + } - ... # code before view +To add things to an C action that are called I rendering, +you can set it up like this: - $c->NEXT::end( $c ); - - ... # code after view - } + sub render : ActionClass('RenderView') { } + + sub end : Private { + my ( $self, $c ) = @_; + $c->forward('render'); + # do stuff here + } =head2 Catalyst on shared hosting