RSS channel (feed).
RSS channel (feed).
AnewtRssChannel instances handle a number of properties , which you can set using regular AnewtContainer::set() method calls. These will end up as elements of your RSS channel.
The required properties are:
title link description The optional properties are:
language copyright editor webmaster date build-date generator time-to-live image The url property can be used to set a custom URL which will be included in a atom:link element, as suggested by the FeedValidator people. The default url detection will work in most cases though, so there's usually no need to fiddle with this.
You can specify the text encoding used with the encoding property. This defaults to UTF-8. The Anewt RSS module does not do character set conversion, so you should make sure your values are in the right character set before you set them on the AnewtRssChannel and AnewtRssItem instances.
There is also a content-type property that is set to the correct MIME type, i.e. application/rss+xml. You should not override this except for testing, e.g. temporarily serving as text/html helps with debugging your feed. Even though there are lots of text/xml feeds on the web, you should really stick to application/rss+xml. No cookies for you if you change it for production use!
After setting the channel properties, you can add AnewtRssItem instances to it using AnewtRssChannel::add_item(). Finally, you output the complete channel using AnewtRssChannel::flush().
__construct($title=null, $link=null, $description=null) ¶Create a new channel object.
For convenience, this constructor takes three parameters that must be set according to the RSS specification. If you don't set them here, you're supposed to provided them later by calling the set() method.
$titleThe channel's title (optional).
$linkThe channel's link (optional).
$descriptionThe channel's description (optional).
flush() ¶Output the channel to a browser.
This renders the page to the browser, including the correct Content-type headers and XML prolog.
static _build_rss_element($obj, $property, $tagname, $status, $type) [static] ¶Helper function to create RSS XML elements.
This is only for internal use.
$objThe object from which to retrieve the value
$propertyThe property name
$tagnameThe XML tag name
$statusStatus of the element
$typeData type of the element
An AnewtXMLDomElement instance, or null.
build_document() [private] ¶Build an XML document for this channel.
$properties [private] ¶List of properties and their specification.
AnewtContainer::_to_array()AnewtContainer::_add()AnewtContainer::delete()AnewtContainer::get()AnewtContainer::_isset()AnewtContainer::_seed()AnewtContainer::setdefault()AnewtContainer::getdefault()AnewtContainer::set()AnewtContainer::__isset()AnewtContainer::__set()AnewtContainer::__construct()AnewtContainer::is_set()AnewtContainer::add()AnewtContainer::_getdefault()AnewtContainer::__unset()AnewtContainer::seed()AnewtContainer::to_array()AnewtContainer::_get()AnewtContainer::__get()AnewtContainer::keys()AnewtContainer::clear()AnewtContainer::_keys()AnewtContainer::_set()