You are here

public function ContextualLinks::preRender in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/contextual/src/Plugin/views/field/ContextualLinks.php \Drupal\contextual\Plugin\views\field\ContextualLinks::preRender()

Runs before any fields are rendered.

This gives the handlers some time to set up before any handler has been rendered.

Parameters

\Drupal\views\ResultRow[] $values: An array of all ResultRow objects returned from the query.

Overrides FieldPluginBase::preRender

File

core/modules/contextual/src/Plugin/views/field/ContextualLinks.php, line 73

Class

ContextualLinks
Provides a handler that adds contextual links.

Namespace

Drupal\contextual\Plugin\views\field

Code

public function preRender(&$values) {

  // Add a row plugin css class for the contextual link.
  $class = 'contextual-region';
  if (!empty($this->view->style_plugin->options['row_class'])) {
    $this->view->style_plugin->options['row_class'] .= " {$class}";
  }
  else {
    $this->view->style_plugin->options['row_class'] = $class;
  }
}