You are here

public function GoogleNews::render in Views Google News 8

Render the display in this style.

Overrides StylePluginBase::render

File

src/Plugin/views/style/GoogleNews.php, line 59

Class

GoogleNews
Default style plugin to render an GoogleNews feed.

Namespace

Drupal\views_googlenews\Plugin\views\style

Code

public function render() {
  if (empty($this->view->rowPlugin)) {
    debug('Drupal\\views\\Plugin\\views\\style\\GoogleNews: Missing row plugin');
    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;
}