Markup.php in Display Suite 8.4
File
src/Plugin/DsField/Markup.php
View source
<?php
namespace Drupal\ds\Plugin\DsField;
abstract class Markup extends DsFieldBase {
public function build() {
$key = $this
->key();
if (isset($this
->entity()->{$key}->value)) {
$format = $this
->format();
return [
'#type' => 'processed_text',
'#text' => $this
->entity()->{$key}->value,
'#format' => $format,
'#filter_types_to_skip' => [],
'#langcode' => '',
];
}
return [];
}
protected function key() {
return '';
}
protected function format() {
return 'filtered_html';
}
}
Classes
Name |
Description |
Markup |
DS field markup base field. |