SingleTextFieldTest.php in Extra Field 8.2
File
tests/extra_field_test/src/Plugin/ExtraField/Display/SingleTextFieldTest.php
View source
<?php
namespace Drupal\extra_field_test\Plugin\ExtraField\Display;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\extra_field\Plugin\ExtraFieldDisplayFormattedBase;
class SingleTextFieldTest extends ExtraFieldDisplayFormattedBase {
public function viewElements(ContentEntityInterface $entity) {
return [
'#markup' => 'Output from SingleTextFieldTest',
];
}
public function getLabel() {
return 'Single text';
}
public function getLabelDisplay() {
return 'inline';
}
public function getFieldType() {
return 'single_text';
}
public function getFieldName() {
return 'field_single_text';
}
}