You are here

public function DashboardBlock::__construct in Dashboards with Layout Builder 2.0.x

Same name in this branch
  1. 2.0.x src/Plugin/Derivative/DashboardBlock.php \Drupal\dashboards\Plugin\Derivative\DashboardBlock::__construct()
  2. 2.0.x src/Plugin/Block/DashboardBlock.php \Drupal\dashboards\Plugin\Block\DashboardBlock::__construct()
Same name and namespace in other branches
  1. 8 src/Plugin/Block/DashboardBlock.php \Drupal\dashboards\Plugin\Block\DashboardBlock::__construct()

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/DashboardBlock.php, line 34

Class

DashboardBlock
Provides a dashboard block.

Namespace

Drupal\dashboards\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, PluginManagerInterface $plugin_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $id = explode(':', $this
    ->getDerivativeId())[1];
  $this->basePlugin = $plugin_manager
    ->createInstance($id);
}