public function ComputedPhpFormatterBase::formatItem in Computed Field 8.2
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldFormatter/ComputedPhpFormatterBase.php \Drupal\computed_field\Plugin\Field\FieldFormatter\ComputedPhpFormatterBase::formatItem()
Do something with the value before displaying it.
Parameters
mixed $value: The (computed) value of the item.
\Drupal\Core\Field\FieldItemInterface $item: The item to format for output
int $delta: The delta value (index) of the item in case of multiple items
string $langcode: The language code
Return value
mixed
1 call to ComputedPhpFormatterBase::formatItem()
- ComputedPhpFormatterBase::viewElements in src/
Plugin/ Field/ FieldFormatter/ ComputedPhpFormatterBase.php - Builds a renderable array for a field value.
2 methods override ComputedPhpFormatterBase::formatItem()
- ComputedPhpFormatterExample::formatItem in computed_field_example_formatter/
src/ Plugin/ Field/ FieldFormatter/ ComputedPhpFormatterExample.php - Do something with the value before displaying it.
- ComputedPhpFormatterPhp::formatItem in computed_field_php_formatter/
src/ Plugin/ Field/ FieldFormatter/ ComputedPhpFormatterPhp.php - Do something with the value before displaying it.
File
- src/
Plugin/ Field/ FieldFormatter/ ComputedPhpFormatterBase.php, line 59
Class
- ComputedPhpFormatterBase
- Base class for own php-formatter
Namespace
Drupal\computed_field\Plugin\Field\FieldFormatterCode
public function formatItem($value, FieldItemInterface $item, $delta = 0, $langcode = NULL) {
return $value;
}