You are here

public function BlockTab::__construct in Block Tabs 8

Overrides \Drupal\Component\Plugin\PluginBase::__construct().

Overrides the construction of context aware plugins to allow for unvalidated constructor based injection of contexts.

Parameters

array $configuration: The plugin configuration, i.e. an array with configuration values keyed by configuration option name. The special key 'context' may be used to initialize the defined contexts by setting it to an array of context values keyed by context names.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides TabBase::__construct

File

src/Plugin/Tab/BlockTab.php, line 53

Class

BlockTab
Block tab.

Namespace

Drupal\blocktabs\Plugin\Tab

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerInterface $logger, BlockManagerInterface $block_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $logger);
  $config = $this->configuration['config'];
  $this->blockManager = $block_manager;
  $this->blockPlugin = $this->blockManager
    ->createInstance($this->configuration['block_id'], $config);
}