Mango::Catalyst::View::Feed - View class for XML::Feed based feeds
$c->view('Atom'); $c->view('RSS');
Mango::Catalyst::View::Feed renders a feed using XML::Feed and serves it with the appropriate content type.
There is no real reason to use this view directly. Please use Mango::Catalyst::View::RSS or Mango::Catalyst::View::Atom instead.
When this view is called, it will create a feed using the data in:
$c->stash->{'entity'};
If entity is a hash, each key will be assigned to the XML::Feed object:
entity
$c->stash->{'entity'} = { title => 'My Feed', description => 'This is my feed' entries => [ {title => 'Entry1', id => 1, ...}, {title => 'Entry2', id => 2, ...} ] }; my $feed = XML::Feed->new; my $entity = $c->stash->{'entity'}; $feed->$_($entity->{$_}) for keys %{$entity}
If an entries key is supplied, each item in it will also be converted to an XML::Feed::Entry object and added to the feed. entries may also contain a list of XML::Feed::Entry objects, or objects that support a as_feed_entry method which returns XML::Feed::Entry objects or the appropriate hash.
entries
as_feed_entry
If entity is an XML::Feed object, that is used directly. If entity is an object and it supports the as_feed method, the output from that method will be used. as_feed must return a XML::Feed object or the same entity hash described above.
as_feed
type can be either 'RSS' or 'Atom'.
type
Returns an XML::Feed object from the configuration described above.
Returns a list of XML::Feed::Entry objects from the configuration described above.
Creates an XML::Feed of the specific type, writes it to the response body, changing the content type.
Mango::Catalyst::View::RSS, Mango::Catalyst::View::Atom
Christopher H. Laco CPAN ID: CLACO claco@chrislaco.com http://today.icantfocus.com/blog/
To install Mango, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mango
CPAN shell
perl -MCPAN -e shell install Mango
For more information on module installation, please visit the detailed CPAN module installation guide.