class SingleTextFieldTest in Extra Field 8.2
Same name and namespace in other branches
- 8 tests/extra_field_test/src/Plugin/ExtraField/Display/SingleTextFieldTest.php \Drupal\extra_field_test\Plugin\ExtraField\Display\SingleTextFieldTest
Extra field Display for a field with single item output.
Plugin annotation
@ExtraFieldDisplay(
id = "single_text_test",
label = @Translation("Extra field formatted as text field"),
description = @Translation("An extra field formatted as text field."),
bundles = {
"node.first_node_type",
},
visible = true
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\extra_field\Plugin\ExtraFieldDisplayBase implements ExtraFieldDisplayInterface
- class \Drupal\extra_field\Plugin\ExtraFieldDisplayFormattedBase implements ExtraFieldDisplayFormattedInterface
- class \Drupal\extra_field_test\Plugin\ExtraField\Display\SingleTextFieldTest
- class \Drupal\extra_field\Plugin\ExtraFieldDisplayFormattedBase implements ExtraFieldDisplayFormattedInterface
- class \Drupal\extra_field\Plugin\ExtraFieldDisplayBase implements ExtraFieldDisplayInterface
Expanded class hierarchy of SingleTextFieldTest
1 file declares its use of SingleTextFieldTest
- ExtraFieldDisplayPluginTest.php in tests/
src/ Kernel/ ExtraFieldDisplayPluginTest.php
File
- tests/
extra_field_test/ src/ Plugin/ ExtraField/ Display/ SingleTextFieldTest.php, line 21
Namespace
Drupal\extra_field_test\Plugin\ExtraField\DisplayView source
class SingleTextFieldTest extends ExtraFieldDisplayFormattedBase {
/**
* {@inheritdoc}
*/
public function viewElements(ContentEntityInterface $entity) {
return [
'#markup' => 'Output from SingleTextFieldTest',
];
}
/**
* {@inheritdoc}
*/
public function getLabel() {
return 'Single text';
}
/**
* {@inheritdoc}
*/
public function getLabelDisplay() {
return 'inline';
}
/**
* {@inheritdoc}
*/
public function getFieldType() {
return 'single_text';
}
/**
* {@inheritdoc}
*/
public function getFieldName() {
return 'field_single_text';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExtraFieldDisplayBase:: |
protected | property | The field's parent entity. | |
ExtraFieldDisplayBase:: |
protected | property | The entity view display. | |
ExtraFieldDisplayBase:: |
protected | property | The view mode the entity is rendered in. | |
ExtraFieldDisplayBase:: |
public | function |
Returns the field's parent entity. Overrides ExtraFieldDisplayInterface:: |
|
ExtraFieldDisplayBase:: |
public | function |
Returns the entity view display object of the field's host entity. Overrides ExtraFieldDisplayInterface:: |
|
ExtraFieldDisplayBase:: |
public | function |
Returns the entity view mode object of the field's host entity. Overrides ExtraFieldDisplayInterface:: |
|
ExtraFieldDisplayBase:: |
public | function |
Stores the field's parent entity. Overrides ExtraFieldDisplayInterface:: |
|
ExtraFieldDisplayBase:: |
public | function |
Stores the entity view display. Overrides ExtraFieldDisplayInterface:: |
|
ExtraFieldDisplayBase:: |
public | function |
Stores the entity view mode. Overrides ExtraFieldDisplayInterface:: |
|
ExtraFieldDisplayFormattedBase:: |
protected | property | Flag to indicate that the extra field has no content. | |
ExtraFieldDisplayFormattedBase:: |
protected | property | The langcode of the field values. | |
ExtraFieldDisplayFormattedBase:: |
protected | property | The language manager. | |
ExtraFieldDisplayFormattedBase:: |
public | function |
Gets the langcode of the field values. Overrides ExtraFieldDisplayFormattedInterface:: |
1 |
ExtraFieldDisplayFormattedBase:: |
public | function |
Check if the extra field has data. Overrides ExtraFieldDisplayFormattedInterface:: |
|
ExtraFieldDisplayFormattedBase:: |
public | function |
The field is translatable. Overrides ExtraFieldDisplayFormattedInterface:: |
1 |
ExtraFieldDisplayFormattedBase:: |
public | function | Set the language code. | |
ExtraFieldDisplayFormattedBase:: |
public | function |
Builds a renderable array for the field. Overrides ExtraFieldDisplayInterface:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |
SingleTextFieldTest:: |
public | function |
The machine name of the field. Overrides ExtraFieldDisplayFormattedBase:: |
|
SingleTextFieldTest:: |
public | function |
The type of field. Overrides ExtraFieldDisplayFormattedBase:: |
|
SingleTextFieldTest:: |
public | function |
The label of the field. Overrides ExtraFieldDisplayFormattedBase:: |
|
SingleTextFieldTest:: |
public | function |
How to display the field label will be displayed. Overrides ExtraFieldDisplayFormattedBase:: |
|
SingleTextFieldTest:: |
public | function |
Returns the renderable array of the field item(s). Overrides ExtraFieldDisplayFormattedInterface:: |