Catalyst-Manual

 view release on metacpan or  search on metacpan

lib/Catalyst/Manual/Cookbook.pod  view on Meta::CPAN

'entries' with some L<DBIx::Class> iterator, the code would look something
like this:

    sub rss : Local {
        my ($self,$c) = @_;
        $c->forward('view'); # get the entries

        my $feed = XML::Feed->new('RSS');
        $feed->title( $c->config->{name} . ' RSS Feed' );
        $feed->link( $c->req->base ); # link to the site.
        $feed->description('Catalyst advent calendar'); Some description

        # Process the entries
        while( my $entry = $c->stash->{entries}->next ) {
            my $feed_entry = XML::Feed::Entry->new('RSS');
            $feed_entry->title($entry->title);
            $feed_entry->link( $c->uri_for($entry->link) );
            $feed_entry->issued( DateTime->from_epoch(epoch => $entry->created) );
            $feed->add_entry($feed_entry);
        }
        $c->res->body( $feed->as_xml );

lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod  view on Meta::CPAN

C<:PathPart('books/url_create')> to specify the base URL to match, and
C<:Args(3)> to capture exactly three arguments and to end the chain.

As we will see shortly, a chain can consist of as many "links" as you
wish, with each part capturing some arguments and doing some work along
the way.  We will continue to use the Chained action type in this
chapter of the tutorial and explore slightly more advanced capabilities
with the base method and delete feature below.  But Chained dispatch is
capable of far more.  For additional information, see
L<Catalyst::Manual::Intro/Action types>,
L<Catalyst::DispatchType::Chained>, and the 2006 Advent calendar entry
on the subject: L<http://www.catalystframework.org/calendar/2006/10>.


=head2 Try the Chained Action

If you look back at the development server startup logs from your
initial version of the C<url_create> method (the one using the C<:Local>
attribute), you will notice that it produced output similar to the
following:

    [debug] Loaded Path actions:



( run in 1.285 second using v1.01-cache-2.11-cpan-c333fce770f )