Used to build a RSS feed.
| Parameters: |
|
|---|---|
| Encoding : | Default UTF-8. Used for the XML encoding attribute. |
| Version : | Default 2.0. Used for XML version attribute (<rss> tag). You can define any other key, which will be transformed into XML tag in the <channel /> |
| Returns: | A instance of Tools_RSS. |
| Parameters: |
|
|---|
Set one or multiple channel properties.
| Parameters: |
|
|---|
Set a new array of items.
| Parameters: |
|
|---|
Add a new item to the $items array.
| Parameters: |
|
|---|---|
| Returns: | The XML description of the RSS |
See Tools_RSS::forge for parameters.
The pubDate key can be a Fuel\\Core\\Date instance, or a string (date representation) or a timestamp.
<?php
$rss = \Nos\Tools_RSS::forge('RSS title');
$rss->set_items(array(
'title' => 'Item title',
'link' => 'http://www.mydomain.com/item_url.html',
'description' => '<p>A description of item </p>',
'pubDate' => '2012-08-16',
'author' => 'Me',
));
$xml = $rss->build();
$rss->set('subtitle', 'A subtitle for ma RSS');
echo $rss; // Call $rss->build() with magic method __ toString()