function RowPluginBase::render

Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/row/RowPluginBase.php \Drupal\views\Plugin\views\row\RowPluginBase::render()
  2. 10 core/modules/views/src/Plugin/views/row/RowPluginBase.php \Drupal\views\Plugin\views\row\RowPluginBase::render()
  3. 9 core/modules/views/src/Plugin/views/row/RowPluginBase.php \Drupal\views\Plugin\views\row\RowPluginBase::render()
  4. 8.9.x core/modules/views/src/Plugin/views/row/RowPluginBase.php \Drupal\views\Plugin\views\row\RowPluginBase::render()

Creates a render array for a row object.

This usually passes through to a theme template of some form, but not always.

Parameters

\Drupal\views\ResultRow $row: A single row of the query result, so an element of $view->result.

Return value

array The render array for a single row, used by the style plugin.

9 methods override RowPluginBase::render()
DataEntityRow::render in core/modules/rest/src/Plugin/views/row/DataEntityRow.php
Creates a render array for a row object.
DataFieldRow::render in core/modules/rest/src/Plugin/views/row/DataFieldRow.php
Creates a render array for a row object.
EntityRow::render in core/modules/views/src/Plugin/views/row/EntityRow.php
Creates a render array for a row object.
OpmlFields::render in core/modules/views/src/Plugin/views/row/OpmlFields.php
Creates a render array for a row object.
RowTest::render in core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
Creates a render array for a row object.

... See full list

File

core/modules/views/src/Plugin/views/row/RowPluginBase.php, line 183

Class

RowPluginBase
Base class for Views row plugins.

Namespace

Drupal\views\Plugin\views\row

Code

public function render($row) {
  if (!$row instanceof ResultRow) {
    @trigger_error('Passing an object other than a ResultRow to RowPluginBase::render() is deprecated in drupal:11.4.0 and will throw a type error in drupal:12.0.0. Pass a \\Drupal\\views\\ResultRow object instead. See https://www.drupal.org/node/2939099', E_USER_DEPRECATED);
  }
  return [
    '#theme' => $this->themeFunctions(),
    '#view' => $this->view,
    '#options' => $this->options,
    '#row' => $row,
    '#field_alias' => $this->field_alias ?? '',
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.