You are here

function Rss::render in Views (for Drupal 7) 8.3

Same name in this branch
  1. 8.3 lib/Views/node/Plugin/views/row/Rss.php \Views\node\Plugin\views\row\Rss::render()
  2. 8.3 lib/Views/comment/Plugin/views/row/Rss.php \Views\comment\Plugin\views\row\Rss::render()
  3. 8.3 lib/Views/aggregator/Plugin/views/row/Rss.php \Views\aggregator\Plugin\views\row\Rss::render()
  4. 8.3 lib/Drupal/views/Plugin/views/style/Rss.php \Drupal\views\Plugin\views\style\Rss::render()

Render the display in this style.

Overrides StylePluginBase::render

File

lib/Drupal/views/Plugin/views/style/Rss.php, line 110
Definition of Drupal\views\Plugin\views\style\Rss.

Class

Rss
Default style plugin to render an RSS feed.

Namespace

Drupal\views\Plugin\views\style

Code

function render() {
  if (empty($this->row_plugin)) {
    debug('Drupal\\views\\Plugin\\views\\style\\Rss: Missing row plugin');
    return;
  }
  $rows = '';

  // This will be filled in by the row plugin and is used later on in the
  // theming output.
  $this->namespaces = array(
    'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',
  );

  // Fetch any additional elements for the channel and merge in their
  // namespaces.
  $this->channel_elements = $this
    ->get_channel_elements();
  foreach ($this->channel_elements as $element) {
    if (isset($element['namespace'])) {
      $this->namespaces = array_merge($this->namespaces, $element['namespace']);
    }
  }
  foreach ($this->view->result as $row_index => $row) {
    $this->view->row_index = $row_index;
    $rows .= $this->row_plugin
      ->render($row);
  }
  $output = theme($this
    ->themeFunctions(), array(
    'view' => $this->view,
    'options' => $this->options,
    'rows' => $rows,
  ));
  unset($this->view->row_index);
  return $output;
}