Back to the module list

Really Simple Syndication

The class create a valid RSS XML.

Usage

$rss = new Domframework\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 Domframework\Rss

Namespace Domframework

Description

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

 Will use RssItem class

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