function PluginBase::getRenderer

Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/PluginBase.php \Drupal\views\Plugin\views\PluginBase::getRenderer()

Returns the render API renderer.

Return value

\Drupal\Core\Render\RendererInterface

File

core/modules/views/src/Plugin/views/PluginBase.php, line 660

Class

PluginBase
Base class for any views plugin types.

Namespace

Drupal\views\Plugin\views

Code

protected function getRenderer() {
  if (!isset($this->renderer)) {
    $this->renderer = \Drupal::service('renderer');
  }
  return $this->renderer;
}

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