RssWidget implements WidgetRendererInterface

Concrete RSS widget implementation

The widget will show a certain number of items of the given RSS feed. The feed will be set by the feedUrl option. You can add a button to the widget by defining a button provider.

The following options are available during registration:

  • feedUrl string Defines the URL or file providing the RSS Feed. This is read by the widget in order to fetch entries to show.
  • limit int default: 5 Defines how many RSS items should be shown.
  • lifetime int default: 43200 Defines how long to wait, in seconds, until fetching RSS Feed again
Tags
see
ButtonProviderInterface

Table of Contents

Interfaces

WidgetRendererInterface
The WidgetRendererInterface is the (new) base interface for all kind of widgets.

Methods

__construct()  : mixed
getSettingsDefinitions()  : array<string|int, SettingDefinition>
renderWidget()  : WidgetResult
This method returns the content of a widget. The returned markup will be delivered by an AJAX call and will not be escaped.
determineFeedType()  : string
getFeedItems()  : array<string|int, mixed>
parseAtomFeed()  : array<string|int, mixed>
parseRssFeed()  : array<string|int, mixed>

Methods

renderWidget()

This method returns the content of a widget. The returned markup will be delivered by an AJAX call and will not be escaped.

public renderWidget(WidgetContext $context) : WidgetResult

Be aware of XSS and ensure that the content is well encoded.

Parameters
$context : WidgetContext
Return values
WidgetResult

determineFeedType()

protected determineFeedType(SimpleXMLElement $feedXml) : string
Parameters
$feedXml : SimpleXMLElement
Return values
string

parseAtomFeed()

protected parseAtomFeed(SimpleXMLElement $atomFeed) : array<string|int, mixed>
Parameters
$atomFeed : SimpleXMLElement
Return values
array<string|int, mixed>

parseRssFeed()

protected parseRssFeed(SimpleXMLElement $rssFeed) : array<string|int, mixed>
Parameters
$rssFeed : SimpleXMLElement
Return values
array<string|int, mixed>

        
On this page

Search results