Download the PHP package markocupic/rss-feed-generator-bundle without Composer
On this page you can find all versions of the php package markocupic/rss-feed-generator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download markocupic/rss-feed-generator-bundle
More information about markocupic/rss-feed-generator-bundle
Files in markocupic/rss-feed-generator-bundle
Package rss-feed-generator-bundle
Short Description Simple RSS feed generator. Generate RSS feeds inside a symfony controller.
License MIT
Informations about the package rss-feed-generator-bundle
RSS Feed Generator Bundle
Use this bundle to generate rss feeds inside your Symfony application.
❤ Many thanks to @eko (Vincent Composieux) for giving me the inspiration to program this bundle. https://github.com/eko/FeedBundle.
Installation
composer require markocupic/rss-feed-generator-bundle
Option A: Add this to your config/bundles.php.
Option B: In a Contao ❤ environment register the rss feed generator bundle in the Contao Manager Plugin class of your bundle.
Use dependency injection to require the feed factory in your controller.
Create the feed
Add feed Channel elements
Use the Item class inside the feed factory method FeedFactory::addChannelField().
The Item::__constructor($elementName, $strValue, $arrOptions, $arrAttributes) takes four arguments:
- (string) element name
- (string) content
- optional: (array) options (at the moment cdata, and filters)
- optional: (array) with attributes
Make cdata elements and insert attributes:
Filter od replace content
Add channel items
Use FeedFactory::addChannelItemField(), ItemGroup() and Item() to generate channel items.
The ItemGroup::__constructor($elementName, $arrItemObjects, $arrAttributes) takes three arguments:
- (string) element name
- (array) with Item objects
- optional: (array) with attributes
Nested items
Result:
Render and send content to the browser.
Render and save content to the filesystem.
Generate RSS 2.0 feed inside a controller in a Symfony bundle
Filter & search and replace strings
The extension will filter by default some characters. Linebreaks will be replaced with a whitespace, etc. Please have a look at the Plugin Configuration.
Overriding these defaults is pretty easy and can be done in config/parameters.yml. Please use regular expressions for the search patterns.