function FieldPluginBase::theme
Overrides FieldHandlerInterface::theme
File
-
core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php, line 1790
Class
- FieldPluginBase
- Base class for views fields.
Namespace
Drupal\views\Plugin\views\fieldCode
public function theme(ResultRow $values) {
$renderer = $this->getRenderer();
$build = [
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#field' => $this,
'#row' => $values,
];
$output = $renderer->render($build);
// Set the bubbleable rendering metadata on $view->element. This ensures the
// bubbleable rendering metadata of individual rendered fields is not lost.
// @see \Drupal\Core\Render\Renderer::updateStack()
$this->view->element = $renderer->mergeBubbleableMetadata($this->view->element, $build);
return $output;
}