You are here

class RssFormatView in Services 6.3

@file This file will parse the rss view for the rest server

Hierarchy

Expanded class hierarchy of RssFormatView

2 string references to 'RssFormatView'
hook_rest_server_response_formatters_alter in servers/rest_server/rest_server.api.php
Triggered when the REST server request a list of supported response formats.
rest_server_response_formatters in servers/rest_server/rest_server.module
Builds a list of response formatters that are available to the RESTServer.

File

servers/rest_server/formats/RssFormatView.inc, line 8
This file will parse the rss view for the rest server

View source
class RssFormatView extends RESTServerView {
  function render() {
    $items = '';
    foreach ($this->model as $item) {
      $items .= format_rss_item($item
        ->getName(), $item
        ->getUrl(), $item
        ->getDescription(), array(
        'pubDate' => date('r', $item
          ->getCreated()),
      ));
    }
    $out = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
    $out .= '<rss version="2.0" xml:base="' . url('', array(
      'absolute' => TRUE,
    )) . '"  xmlns:dc="http://purl.org/dc/elements/1.1/">' . "\n";
    $out .= format_rss_channel(variable_get('site_name', ''), url($_GET['q'], array(
      'absolute' => TRUE,
    )), variable_get('site_name', ''), $items);
    return $out;
  }

}

Members