You are here

public function WebformBlock::__construct in Webform 8.5

Creates a WebformBlock instance.

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.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\webform\WebformTokenManagerInterface $token_manager: The webform token manager.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/WebformBlock.php, line 76

Class

WebformBlock
Provides a 'Webform' block.

Namespace

Drupal\webform\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, RequestStack $request_stack, EntityTypeManagerInterface $entity_type_manager, WebformTokenManagerInterface $token_manager, RouteMatchInterface $route_match = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->requestStack = $request_stack;
  $this->entityTypeManager = $entity_type_manager;
  $this->tokenManager = $token_manager;
  $this->routeMatch = $route_match ?: \Drupal::routeMatch();
}