protected function DurationHumanDisplayFormatter::getSeparator in Duration Field 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/DurationHumanDisplayFormatter.php \Drupal\duration_field\Plugin\Field\FieldFormatter\DurationHumanDisplayFormatter::getSeparator()
- 3.0.x src/Plugin/Field/FieldFormatter/DurationHumanDisplayFormatter.php \Drupal\duration_field\Plugin\Field\FieldFormatter\DurationHumanDisplayFormatter::getSeparator()
Converts the key for a separator between values.
Return value
string The value to be inserted between returned elements
1 call to DurationHumanDisplayFormatter::getSeparator()
- DurationHumanDisplayFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ DurationHumanDisplayFormatter.php - Builds a renderable array for a field value.
File
- src/
Plugin/ Field/ FieldFormatter/ DurationHumanDisplayFormatter.php, line 250
Class
- DurationHumanDisplayFormatter
- Provides a formatter for the duration field type.
Namespace
Drupal\duration_field\Plugin\Field\FieldFormatterCode
protected function getSeparator() {
$custom_separators = $this->moduleHandler
->invokeAll('duration_field_separators');
$separators = [
'space' => ' ',
'hyphen' => ' - ',
'comma' => ', ',
'newline' => '<br />',
] + $custom_separators;
return $separators[$this
->getSetting('separator')];
}