You are here

protected function HtmlTitleFormatter::viewValue in HTML Title 8

Generate the output appropriate for one field item.

Parameters

\Drupal\Core\Field\FieldItemInterface $item: One field item.

Return value

array The textual output generated as a render array.

Overrides StringFormatter::viewValue

File

src/Plugin/Field/FieldFormatter/HtmlTitleFormatter.php, line 57

Class

HtmlTitleFormatter
Plugin implementation of the 'html_title' formatter.

Namespace

Drupal\html_title\Plugin\Field\FieldFormatter

Code

protected function viewValue(FieldItemInterface $item) {
  return [
    '#markup' => $this->htmlTitleFilter
      ->decodeToMarkup($item->value),
  ];
}