expomopa.blogg.se

Rss feed generator
Rss feed generator







rss feed generator

return $rss-> render() Render and save content to the filesystem. While ( false != ( $arrEvent = $results-> fetch())) Nested items // Append nested items with ItemGroup. Retrieve data from database and add items $results = $ this-> getEvents( $section) The ItemGroup::_constructor($elementName, $arrItemObjects, $arrAttributes) takes three arguments: Use FeedFactory::addChannelItemField(), ItemGroup() and Item() to generate channel items. Will result in: // Italia is my favourite country! Add channel items New Item( 'description', 'Ferrari is my favourite car!', ) ) Filter od replace content // filter or replace values $arrFilter = New Item( 'description', 'Check our news feed and have fun!',, ) Make cdata elements and insert attributes: // Add CDATA element and an attribute $rss-> addChannelField( optional: (array) options (at the moment cdata, and filters).The Item::_constructor($elementName, $strValue, $arrOptions, $arrAttributes) takes four arguments: Use the Item class inside the feed factory method FeedFactory::addChannelField(). Add one or more attributes to the channel element $rss-> setChannelAttributes([ Add one or more attributes to the root element $rss-> setRootAttributes([ Markocupic\DemoBundle\Controller\Feed\FeedController:Ĭreate the feed // Use the feed factory to generate the feed object $rss = $ this-> feedFactory-> createFeed(\ Markocupic\ RssFeedGeneratorBundle\ Feed\ Feed:: ENCODING_UTF8) Use dependency injection to require the feed factory in your controller. > setLoadAfter( ContaoCoreBundle::class) setLoadAfter( MarkocupicRssFeedGeneratorBundle::class) Option B: In a Contao ❤ environment register the rss feed generator bundle in the Contao Manager Plugin class of your bundle. Option A: Add this to your config/bundles.php. InstallationĬomposer require markocupic/rss-feed-generator-bundle ❤ Many thanks to (Vincent Composieux) for giving me the inspiration to program this bundle. Use this bundle to generate rss feeds inside your Symfony application.









Rss feed generator