Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DisplayPluginBase.php

function DisplayPluginBase::render

Overrides DisplayPluginInterface::render

3 methods override DisplayPluginBase::render()
EntityReference::render in core/modules/views/src/Plugin/views/display/EntityReference.php
Builds the view result as a renderable array.
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 2202

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() : [];
    $element = [
        '#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'],
        '#cache' => &$this->view->element['#cache'],
    ];
    $this->applyDisplayCacheabilityMetadata($this->view->element);
    return $element;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal