You are here

public function Citation::render in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_entity/src/Plugin/views/field/Citation.php \Drupal\bibcite_entity\Plugin\views\field\Citation::render()

Renders the field.

Parameters

\Drupal\views\ResultRow $values: The values retrieved from a single row of a view's query result.

Return value

string|\Drupal\Component\Render\MarkupInterface The rendered output. If the output is safe it will be wrapped in an object that implements MarkupInterface. If it is empty or unsafe it will be a string.

Overrides FieldPluginBase::render

File

modules/bibcite_entity/src/Plugin/views/field/Citation.php, line 89

Class

Citation
Field handler to render bibcite reference as citation.

Namespace

Drupal\bibcite_entity\Plugin\views\field

Code

public function render(ResultRow $values) {
  return [
    '#theme' => 'bibcite_citation',
    '#data' => $this->serializer
      ->normalize($this
      ->getEntity($values), 'csl'),
    '#style' => $this->options['csl_style'] ?: NULL,
  ];
}