Back to the module list

Really Simple Syndication

The class create a valid RSS XML.

Usage

$rss = new rss ();
$rss->title ("Global Title")
    ->link ("http://localhost")
    ->language ("fr-fr")
    ->description  ("The Super Global Description");
$rss->addItem ()->title ("Item1 Title")
                ->link ("http://Item1Link")
                ->description  ("Item1 Description");
$rss->addItem ()->title ("Item2 Title")
                ->pubDate ("2017-04-13 12:25:30")
                ->link ("http://Item2Link")
                ->description  ("Item2 Description");
$res = $rss->asXML ();

The class definition

Class \rss

Namespace \

Description

 Create the RSS pages for the websites
 Specification http://www.rssboard.org/rss-specification

Properties

No property available

Methods

public function addItem ()
 Add a new item to the RSS
 Return the new rss object created

public function asXML ()
 Return the complete RSS in XML format
 Throw an exception if there is some mandatory fields missing

public function description ($description=null)
 Get/Set the value
 @param string|null $description The description to get/set

public function language ($language=null)
 Get/Set the value
 @param string|null $language The language to get/set

public function lastBuildDate ($lastBuildDate=null)
 Get/Set the value
 The date must be in the SQL format Y-m-d H:i:s
 @param string|null $lastBuildDate The lastBuildDate to get/set

public function link ($link=null)
 Get/Set the value
 @param string|null $link The link to get/set

public function title ($title=null)
 Get/Set the value
 @param string|null $title The title to get/set

Class \rss_item

Namespace \

Description

 Define one item in the RSS

Properties

No property available

Methods

public function author ($author=null)
 Get/Set the value
 @param string|null $author The author to get/set

public function comments ($comments=null)
 Get/Set the value
 @param string|null $comments The comments to get/set

public function description ($description=null)
 Get/Set the value
 @param string|null $description The description to get/set

public function guid ($guid=null)
 Get/Set the value
 @param string|null $guid The guid to get/set

public function link ($link=null)
 Get/Set the value
 @param string|null $link The link to get/set

public function pubDate ($pubDate=null)
 Get/Set the value
 @param string|null $pubDate The pubDate to get/set

public function title ($title=null)
 Get/Set the value
 @param string|null $title The title to get/set