Current Record: getFeed #42

getFeed() Delegate Class Method Table of Contents getFeed() Delegate Class Method Synopsis: Parameters Return Value Example See Also...

Current Record: getFeed #42

getFeed() Delegate Class Method Table of Contents getFeed() Delegate Class Method Synopsis: Parameters Return Value Example See Also...

getFeed

[Permalink]

getFeed() Delegate Class Method

Synopsis:

The getFeed() method of a table delegate class or application delegate class returns an associative array of parameters to configure the RSS feed for a particular table . An RSS feed consists of the following components:

  1. title - The title of the RSS feed as it should appear in the subscribers' feed list.
  2. description - Describes the RSS feed.
  3. link - A link to the RSS feed
  4. syndicationURL - The URL to this RSS feed's site.

Parameters

  1. array $query - The HTTP query. Contains information like the current table, current action, and search parameters. This allows you to customize your RSS feed depending on the user's query parameters.

Return Value

The getFeed() method returns an associative array with the components of the RSS feed. This array does not need to contain all possible keys, or even any keys. Any keys that are omitted will simply use default values in the RSS feed. The array may contain the following keys:

Name Description Version
title The title for the RSS feed. If this omitted, it will try to use the title directive of the [_feed] section of the conf.ini file. Failing that, it will try to generate an appropriate title for the feed depending on the current query. 1.0
description A Description for this RSS feed. If this is omitted, it will try to use the description directive of the [_feed] section of the conf.ini file. 1.0
link A link to the source page of the RSS feed. If this is omitted, it will try to use the link directive of the [_feed] section of the conf.ini file. 1.0
syndicationURL A link to the source page of the RSS feed. If this is omitted, it will try to use the syndicationURL directive of the [_feed] section of the conf.ini file. 1.0

Example

function getFeed(&$query){
    return array(
        'title' => "RSS feed for the ".$query['-table']." table.",
        'description' => "News and updates for automobiles",
        'link' => df_absolute_url(DATAFACE_SITE_HREF),
        'syndicationURL' => df_absolute_url(DATAFACE_SITE_HREF)
    );
}

Note that RSS feeds will work perfectly well without defining this method. This just allows you to customize one or more parameters of the RSS feed.

See Also:

blog comments powered by Disqus
Powered by Xataface
(c) 2005-2024 All rights reserved