Plugin Method showRSS()

public function showRSS() {
    
    //...your PHP code...//
}

Summary

Provides you with the means to write RSS for your Plugin.

Where You Can Use It

In your pluggable modules, from Zenario 7.0 onwards.

Description

Your showRSS() method should output XML to the screen.

Before you can write your showRSS() method, you must set up an RSS link on the page using the addToPageHead() method.

Note: The CMS will send the appropriate XML header() command for you automatically.

Return Value

No return value is needed.

Example

public function showRSS() {
    echo '
<?xml version="1.0" encoding="UTF-8" ?>
    <rss version="2.0">
        <channel>
            <title>', $this->title, '</title>
            <link>', $this->linkToItem($this->cID, $this->cType, true), '</link>
            <description><!--Description--></description>';

    
    foreach($this->items as $item) {
        echo '
                <item>
                    <title>', $item->title, '</title>
                    <description>', $item->description, '</description>
                    <link>', $this->linkToItem($this->cID, $this->cType, true), '</link>
                    <pubDate>', $item->date, '</pubDate>
                </item>';
    }

    echo '
        </channel>
    </rss>';
}

This example can be used in conjunction with the addToPageHead() method to show an RSS link.

Tip

You can use the Framework system to store your XML schema, rather than hard-coding it into your PHP code.