protected function GroupChannelFormatter::viewValue in Rocket.Chat 8.2
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.
1 call to GroupChannelFormatter::viewValue()
- GroupChannelFormatter::viewElements in modules/
rocket_chat_group/ src/ Plugin/ Field/ FieldFormatter/ GroupChannelFormatter.php - Builds a renderable array for a field value.
File
- modules/
rocket_chat_group/ src/ Plugin/ Field/ FieldFormatter/ GroupChannelFormatter.php, line 76
Class
- GroupChannelFormatter
- Class GroupChannelFormatter
Namespace
Drupal\rocket_chat_group\Plugin\Field\FieldFormatterCode
protected function viewValue(FieldItemInterface $item) {
// The text value has no text format assigned to it, so the user input
// should equal the output, including newlines.
return [
'#type' => 'inline_template',
'#template' => '{{ value|raw }}',
//|nl2br
'#context' => [
'value' => $item->value,
],
];
}