You are here

public function ExtrafieldViewsIntegration::render in Extrafield Views Integration 8

inheritdoc}

Overrides FieldPluginBase::render

File

src/Plugin/views/field/ExtrafieldViewsIntegration.php, line 27

Class

ExtrafieldViewsIntegration
Field handler.

Namespace

Drupal\extrafield_views_integration\Plugin\views\field

Code

public function render(ResultRow $values) {
  if (class_exists($this->definition['render_class'])) {

    /** @var ExtrafieldRenderClassInterface $class */
    $class = $this->definition['render_class'];
    return $class::render($values->_entity);
  }
  else {
    drupal_set_message(t('An error occurred render_class: @render_class doesn´t exists.', array(
      '@render_class' => $this->definition['render_class'],
    )), 'warning');
  }
}