Method | Description | |
---|---|---|
addCDATAEncoding ( array $tags ) : self | Add one or more tags to the list of CDATA encoded tags | |
addGenerator ( ) : self | Add a channel element indicating the program used to generate the feed. | |
addItem ( |
Add a FeedItem to the main class | |
addNamespace ( string $prefix, string $uri ) : self | Add a XML namespace to the internal list of namespaces. After that, custom channel elements can be used properly to generate a valid feed. | |
createNewItem ( ) : |
Create a new Item. | |
filterInvalidXMLChars ( string $string, string $replacement = '_' ) : string | Replace invalid XML characters. | |
generateFeed ( ) : string | Generate the feed. | |
getCDATAEncoding ( ) : array | Get list of CDATA encoded properties | |
getMIMEType ( ) : string | Get the appropriate MIME type string for the current feed. | |
printFeed ( $useGenericContentType = false ) : void | Print the actual RSS/ATOM file | |
removeCDATAEncoding ( array $tags ) : void | Remove tags from the list of CDATA encoded tags | |
setAtomLink ( string $href, string $rel = null, string $type = null, string $hreflang = null, string $title = null, integer $length = null ) : self | Set custom 'link' channel elements. | |
setChannelAbout ( string $url ) : self | Set the channel 'rdf:about' attribute, which is used in RSS1 feeds only. | |
setChannelElement ( string $elementName, string $content, array $attributes = null, $multiple = false ) : self | Add a channel element to the feed. | |
setChannelElementsFromArray ( array $elementArray ) : self | Set multiple channel elements from an array. Array elements should be 'channelName' => 'channelContent' format. | |
setDate ( $date ) : self | Set the date when the feed was lastly updated. | |
setDescription ( string $description ) : self | Set a phrase or sentence describing the feed. | |
setEncoding ( string $encoding ) : self | Set the 'encoding' attribute in the XML prolog. | |
setImage ( string $url, string $title = null, string $link = null ) : self | Set the 'image' channel element | |
setLink ( string $link ) : self | Set the 'link' channel element | |
setPagination ( string $nextURL = null, string $previousURL = null, string $firstURL = null, string $lastURL = null ) : self | Set the URLs for feed pagination. | |
setSelfLink ( string $url ) : self | Set an 'atom:link' channel element with relation=self attribute. | |
setTitle ( string $title ) : self | Set the 'title' channel element | |
uuid ( string $key = null, string $prefix = '' ) : string | Generate an UUID. |
Method | Description | |
---|---|---|
__construct ( string $version = Feed::RSS2 ) | Constructor |
Method | Description | |
---|---|---|
endItem ( ) : string | Closes feed item tag | |
getNamespacePrefixes ( ) : array | Returns all used XML namespace prefixes in this instance. | |
makeChannels ( ) : string | Make the channels. | |
makeFooter ( ) : string | Closes the open tags at the end of file | |
makeHeader ( ) : string | Returns the XML header and root element, depending on the feed type. | |
makeItems ( ) : string | Prints formatted feed items | |
makeNode ( string $tagName, mixed $tagContent, array $attributes = null, boolean $omitEndTag = false ) : string | Creates a single node in XML format | |
sanitizeCDATA ( string $text ) : string | Sanitizes data which will be later on returned as CDATA in the feed. | |
startItem ( string $about = false ) : string | Make the starting tag of channels |
protected __construct ( string $version = Feed::RSS2 ) | ||
$version | string | the version constant (RSS1/RSS2/ATOM). |
public addCDATAEncoding ( array $tags ) : self | ||
$tags | array | An array of tag names that are merged into the list of tags which should be encoded as CDATA |
return | self |
public addGenerator ( ) : self | ||
return | self |
public addItem ( |
||
$feedItem | instance of Item class | |
return | self |
public addNamespace ( string $prefix, string $uri ) : self | ||
$prefix | string | namespace prefix |
$uri | string | namespace name (URI) |
return | self |
public createNewItem ( ) : |
||
return | instance of Item class |
public generateFeed ( ) : string | ||
return | string | The complete feed XML. |
public getCDATAEncoding ( ) : array | ||
return | array | Return an array of CDATA properties that are to be encoded as CDATA |
public getMIMEType ( ) : string | ||
return | string | The MIME type string. |
public removeCDATAEncoding ( array $tags ) : void | ||
$tags | array | An array of tag names that should be removed. |
return | void |
public setAtomLink ( string $href, string $rel = null, string $type = null, string $hreflang = null, string $title = null, integer $length = null ) : self | ||
$href | string | URI of this link |
$rel | string | relation type of the resource |
$type | string | MIME type of the target resource |
$hreflang | string | language of the resource |
$title | string | human-readable information about the resource |
$length | integer | length of the resource in bytes |
return | self |
public setChannelAbout ( string $url ) : self | ||
$url | string | value of 'rdf:about' attribute of the channel element |
return | self |
public setChannelElementsFromArray ( array $elementArray ) : self | ||
$elementArray | array | |
return | self |
public setDate ( $date ) : self | ||
return | self |
public setDescription ( string $description ) : self | ||
$description | string | Description of the feed. |
return | self |
public setEncoding ( string $encoding ) : self | ||
$encoding | string | value of 'encoding' attribute |
return | self |
public setPagination ( string $nextURL = null, string $previousURL = null, string $firstURL = null, string $lastURL = null ) : self | ||
$nextURL | string | The URL to the next page of this feed. Optional. |
$previousURL | string | The URL to the previous page of this feed. Optional. |
$firstURL | string | The URL to the first page of this feed. Optional. |
$lastURL | string | The URL to the last page of this feed. Optional. |
return | self |
public setSelfLink ( string $url ) : self | ||
$url | string | URL to this feed |
return | self |