function BlockDisplayVariant::__construct
Same name in other branches
- 8.x-3.x src/Plugin/DisplayVariant/BlockDisplayVariant.php \Drupal\ctools\Plugin\DisplayVariant\BlockDisplayVariant::__construct()
Constructs a new BlockDisplayVariant.
Parameters
array $configuration: A configuration array containing information about the plugin instance.
string $plugin_id: The plugin ID for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler: The context handler.
\Drupal\Core\Session\AccountInterface $account: The current user.
\Drupal\Component\Uuid\UuidInterface $uuid_generator: The UUID generator.
\Drupal\Core\Utility\Token $token: The token service.
\Drupal\Core\Block\BlockManagerInterface $block_manager: The block manager.
\Drupal\Core\Condition\ConditionManager $condition_manager: The condition manager.
Overrides VariantBase::__construct
File
-
src/
Plugin/ DisplayVariant/ BlockDisplayVariant.php, line 86
Class
- BlockDisplayVariant
- Provides a base class for a display variant that simply contains blocks.
Namespace
Drupal\ctools\Plugin\DisplayVariantCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, ContextHandlerInterface $context_handler, AccountInterface $account, UuidInterface $uuid_generator, Token $token, BlockManagerInterface $block_manager, ConditionManager $condition_manager) {
// Inject dependencies as early as possible, so they can be used in
// configuration.
$this->contextHandler = $context_handler;
$this->account = $account;
$this->uuidGenerator = $uuid_generator;
$this->token = $token;
$this->blockManager = $block_manager;
$this->conditionManager = $condition_manager;
parent::__construct($configuration, $plugin_id, $plugin_definition);
}