class EntitySubmenuBlock in Entity Submenu Block 8
Same name in this branch
- 8 src/Plugin/Derivative/EntitySubmenuBlock.php \Drupal\entity_submenu_block\Plugin\Derivative\EntitySubmenuBlock
- 8 src/Plugin/Block/EntitySubmenuBlock.php \Drupal\entity_submenu_block\Plugin\Block\EntitySubmenuBlock
Provides block plugin definitions for custom menus.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\system\Plugin\Derivative\SystemMenuBlock implements ContainerDeriverInterface
- class \Drupal\entity_submenu_block\Plugin\Derivative\EntitySubmenuBlock uses StringTranslationTrait
- class \Drupal\system\Plugin\Derivative\SystemMenuBlock implements ContainerDeriverInterface
Expanded class hierarchy of EntitySubmenuBlock
See also
\Drupal\system\Plugin\Block\SystemMenuBlock
File
- src/
Plugin/ Derivative/ EntitySubmenuBlock.php, line 13
Namespace
Drupal\entity_submenu_block\Plugin\DerivativeView source
class EntitySubmenuBlock extends SystemMenuBlock {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->menuStorage
->loadMultiple() as $menu => $entity) {
$this->derivatives[$menu] = $base_plugin_definition;
$this->derivatives[$menu]['admin_label'] = $entity
->label() . ' (' . $this
->t('Entity Submenu Block') . ')';
$this->derivatives[$menu]['config_dependencies']['config'] = array(
$entity
->getConfigDependencyName(),
);
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
EntitySubmenuBlock:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides SystemMenuBlock:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
SystemMenuBlock:: |
protected | property | The menu storage. | |
SystemMenuBlock:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
SystemMenuBlock:: |
public | function | Constructs new SystemMenuBlock. |