class ExampleArticle in Extra Field 8.2
Same name and namespace in other branches
- 8 modules/extra_field_example/src/Plugin/ExtraField/Display/ExampleArticle.php \Drupal\extra_field_example\Plugin\ExtraField\Display\ExampleArticle
Example Extra field Display.
Plugin annotation
@ExtraFieldDisplay(
id = "article_only",
label = @Translation("Only for articles"),
description = @Translation("An extra field to display static text."),
bundles = {
"node.article",
}
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\extra_field\Plugin\ExtraFieldDisplayBase implements ExtraFieldDisplayInterface
- class \Drupal\extra_field_example\Plugin\ExtraField\Display\ExampleArticle
- class \Drupal\extra_field\Plugin\ExtraFieldDisplayBase implements ExtraFieldDisplayInterface
Expanded class hierarchy of ExampleArticle
File
- modules/
extra_field_example/ src/ Plugin/ ExtraField/ Display/ ExampleArticle.php, line 20
Namespace
Drupal\extra_field_example\Plugin\ExtraField\DisplayView source
class ExampleArticle extends ExtraFieldDisplayBase {
/**
* {@inheritdoc}
*/
public function view(ContentEntityInterface $entity) {
return [
'#markup' => 'This is output from ExampleArticle',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExampleArticle:: |
public | function |
Builds a renderable array for the field. Overrides ExtraFieldDisplayInterface:: |
|
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:: |
|
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 |