You are here

public function DisplayPluginBase::render in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/display/DisplayPluginBase.php \Drupal\views\Plugin\views\display\DisplayPluginBase::render()

Renders this display.

Overrides DisplayPluginInterface::render

3 methods override DisplayPluginBase::render()
EntityReference::render in core/modules/views/src/Plugin/views/display/EntityReference.php
Renders this display.
Feed::render in core/modules/views/src/Plugin/views/display/Feed.php
Renders this display.
RestExport::render in core/modules/rest/src/Plugin/views/display/RestExport.php
Renders this display.

File

core/modules/views/src/Plugin/views/display/DisplayPluginBase.php, line 2120
Contains \Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
Base class for views display plugins.

Namespace

Drupal\views\Plugin\views\display

Code

public function render() {
  $rows = !empty($this->view->result) || $this->view->style_plugin
    ->evenEmpty() ? $this->view->style_plugin
    ->render($this->view->result) : array();
  $element = array(
    '#theme' => $this
      ->themeFunctions(),
    '#view' => $this->view,
    '#pre_render' => [
      [
        $this,
        'elementPreRender',
      ],
    ],
    '#rows' => $rows,
    // Assigned by reference so anything added in $element['#attached'] will
    // be available on the view.
    '#attached' => &$this->view->element['#attached'],
  );
  $this
    ->applyDisplayCachablityMetadata($this->view->element);
  return $element;
}