X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FCookbook.pod;fp=lib%2FCatalyst%2FManual%2FCookbook.pod;h=96be5315fb46aff90e56859c2069705e418c1d41;hp=a17266faa46fecc617a17981745bb81651b786d2;hb=32cebe9b3da2a60f5b8fa62d15ba866ede0994f8;hpb=e4be976b833a588927b71b3c60ea96aa918e9c80 diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index a17266f..96be531 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -965,43 +965,9 @@ different approaches here, but the basic premise is that you forward to the normal view action first to get the objects, then handle the output differently. -=head3 Using TT templates - -This is the approach used in Agave (L). - - sub rss : Local { - my ($self,$c) = @_; - $c->forward('view'); - $c->stash->{template}='rss.tt'; - } - -Then you need a template. Here's the one from Agave: - - - - - [ [% blog.name || c.config.name || "Agave" %] ] RSS Feed - [% base %] - Recent posts - en-us - 40 - [% WHILE (post = posts.next) %] - - [% post.title %] - [% post.formatted_teaser|html%] - [% post.pub_date %] - [% post.full_uri %] - [% post.full_uri %] - [% post.author.screenname %] - - [% END %] - - - =head3 Using XML::Feed -A more robust solution is to use L, as was done in the Catalyst -Advent Calendar. Assuming we have a C action that populates +Assuming we have a C action that populates 'entries' with some DBIx::Class iterator, the code would look something like this: @@ -1025,7 +991,7 @@ like this: $c->res->body( $feed->as_xml ); } -A little more code in the controller, but with this approach you're +With this approach you're pretty sure to get something that validates. Note that for both of the above approaches, you'll need to set the