You are here

public function Opml::render in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/style/Opml.php \Drupal\views\Plugin\views\style\Opml::render()

Render the display in this style.

Overrides StylePluginBase::render

File

core/modules/views/src/Plugin/views/style/Opml.php, line 57

Class

Opml
Default style plugin to render an OPML feed.

Namespace

Drupal\views\Plugin\views\style

Code

public function render() {
  if (empty($this->view->rowPlugin)) {
    trigger_error('Drupal\\views\\Plugin\\views\\style\\Opml: Missing row plugin', E_WARNING);
    return [];
  }
  $rows = [];
  foreach ($this->view->result as $row_index => $row) {
    $this->view->row_index = $row_index;
    $rows[] = $this->view->rowPlugin
      ->render($row);
  }
  $build = [
    '#theme' => $this
      ->themeFunctions(),
    '#view' => $this->view,
    '#options' => $this->options,
    '#rows' => $rows,
  ];
  unset($this->view->row_index);
  return $build;
}