dereuromark / cakephp-feed
A CakePHP plugin containing RssView and AtomView classes for generating RSS 2.0 and Atom 1.0 feeds.
Package info
github.com/dereuromark/cakephp-feed
Type:cakephp-plugin
pkg:composer/dereuromark/cakephp-feed
Requires
- php: >=8.2
- cakephp/cakephp: ^5.1.1
Requires (Dev)
- fig-r/psr2r-sniffer: dev-master
- phpunit/phpunit: ^11.5 || ^12.1 || ^13.0
This package is auto-updated.
Last update: 2026-05-11 13:21:00 UTC
README
A CakePHP plugin containing RssView and AtomView classes for generating RSS 2.0 and Atom 1.0 feeds.
Version notice
This branch is for use with CakePHP 5.1+. See version map for details.
What is this plugin for?
There used to be a core helper for RSS generation, but it had several deficiencies. It also was removed in 4.0. So this plugin aims to provide a better support for feed generation — both RSS 2.0 (the de-facto standard, still required for podcasting) and Atom 1.0 (the cleaner, stricter successor preferred for most modern feeds).
Goals of these view classes
- Support view-less actions via serialize.
- Get rid of the ridiculously verbose "inline" namespace declarations.
- Simplify the use of namespaces and their prefixes (auto-add only those that are actually used).
- Support CDATA (unescaped content).
- Allow mini-templating where necessary.
- Accept friendly shorthands for the common case (bare strings for
link,author,category) while leaving the full attribute shape available for power use.
RSS vs Atom: which one?
- RSS 2.0 if you publish a podcast. Apple Podcasts and the rest of that ecosystem require RSS plus the
itunes:namespace. Also pick RSS if you have a specific reason to target the long tail of RSS-only readers. - Atom 1.0 for almost anything else. Unambiguous date semantics (separate
<published>and<updated>), typed content (text/html/xhtml), structured<author>with<name>/<email>/<uri>, multiple<link rel>per entry, mandatory<id>for proper deduplication. Most modern feed readers parse both equally well, and Atom is strictly less ambiguous. - Both, if you're not sure. Each view class is small; emitting
/feed.rssand/feed.atomfrom the same controller action is a few extra lines.
Additional features
- Automatic View class mapping via
rssandatomextensions.
See my article for details on the history of this view class.
Demo
https://sandbox.dereuromark.de/sandbox/feed-examples
Installation & Docs
Possible TODOs
- Maybe add Feed readers instead of just writers.