PHPackages                             marcw/rss-writer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. marcw/rss-writer

ActiveLibrary

marcw/rss-writer
================

A simple yet powerful RSS2 feed writer with RSS extensions support (like iTunes podcast tags)

0.4.0(9y ago)1334.2k—0%6MITPHP

Since Jun 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/marcw/rss-writer)[ Packagist](https://packagist.org/packages/marcw/rss-writer)[ RSS](/packages/marcw-rss-writer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (11)Used By (0)

RssWriter
=========

[](#rsswriter)

[![Build Status](https://camo.githubusercontent.com/f3c51ce658973924bd9d41bfbe3a793d94a3c1b4a3a6a3bd81a9f2493eef6ce7/68747470733a2f2f7472617669732d63692e6f72672f6d617263772f7273732d7772697465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/marcw/rss-writer)[![SensioLabsInsight](https://camo.githubusercontent.com/5fe23e8317e62f7799d2b3eb713db8fa77bbb26a654bafd8c57806af049be140/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35313564666531622d653331392d343661322d396231322d6231666339353038623561382f6d696e692e706e67)](https://insight.sensiolabs.com/projects/515dfe1b-e319-46a2-9b12-b1fc9508b5a8)[![Coverage Status](https://camo.githubusercontent.com/3be6c215cd9965385582805097d9491f6286f98518d6a26f7ea36167a03e2420/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d617263772f7273732d7772697465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/marcw/rss-writer?branch=master)

A simple, yet powerful and fully customizable RSS 2.0 writing library, with a native support of iTunes podcasting tags and other RSS extensions.

Why a new Rss writing library?
------------------------------

[](#why-a-new-rss-writing-library)

At the time of writing this library, the current state of feed writing libraries was not satisfying. What I found was either difficult to extend, too generic, or wasn't taking advantage of best practices in order to reduce the [Time To First Byte](https://en.wikipedia.org/wiki/Time_To_First_Byte).

Why should I use this over other libraries?
-------------------------------------------

[](#why-should-i-use-this-over-other-libraries)

Use this library if you want:

- RSS2 feeds (because there's no support for other types of feed).
- Extensions for iTunes podcasting, Slash, Sy, DublinCreator, Atom, or just your own.
- Best performance (memory and TTFB) thanks to XML Streaming.
- Object oriented feed creation with POPO

How can I install it?
---------------------

[](#how-can-i-install-it)

Run `composer require marcw/rss-writer`.

How does it work?
-----------------

[](#how-does-it-work)

### Feed creation

[](#feed-creation)

See [this file](tests/RssWriterTest.php).

### Rss Streamed Response

[](#rss-streamed-response)

See [this file](tests/Bridge/Symfony/HttpFoundation/RssStreamedResponseTest.php).

### Symfony Bridge

[](#symfony-bridge)

#### HttpFoundation

[](#httpfoundation)

The library provides an extension to the `Symfony\Component\HttpFoundation\Response` class for streaming rss responses to the client. See [`RssStreamedResponse.php`](src/Bridge/Symfony/HttpFoundation/RssStreamedResponse.php). Use it from your controllers like this:

```
use MarcW\RssWriter\Bridge\Symfony\HttpFoundation\RssStreamedResponse;

public function myAction()
{
    // $channel = ... (whatever you use to create your Channel object)

    return new RssStreamedResponse($channel, $this->get('marcw_rss_writer.rss_writer'));
}
```

#### Form

[](#form)

An iTunes category choice list is available to use in your forms. Follow this example:

```
