class Fruit in Plug 7
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\plug_example\Plugin\fruit\Fruit implements FruitInterface
Expanded class hierarchy of Fruit
File
- modules/
plug_example/ src/ Plugin/ fruit/ Fruit.php, line 12 - Contains Drupal\plug_example\Plugin\fruit\Fruit
Namespace
Drupal\plug_example\Plugin\fruitView source
class Fruit extends PluginBase implements FruitInterface {
/**
* {@inheritdoc}
*/
public function display() {
$definition = $this
->getPluginDefinition();
if (!empty($definition['slimy'])) {
return t('Yikes, %name!', array(
'%name' => $definition['label'],
));
}
return t('Fruit name: %name', array(
'%name' => $definition['label'],
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Fruit:: |
public | function |
Displays a fruit. Overrides FruitInterface:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | |
PluginBase:: |
protected | property | The plugin implementation definition. | |
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:: |
|
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Constructs a Drupal\Component\Plugin\PluginBase object. | 1 |