You are here

public function TokenFilter::__construct in Token Filter 8

Constructs a token filter plugin.

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\Utility\Token $token: The token service.

\Drupal\token\TokenEntityMapperInterface $token_entity_mapper: The token entity mapper service.

\Drupal\Core\Render\RendererInterface $renderer: The renderer service.

\Drupal\Core\Routing\RouteMatchInterface $current_route_match: The route match service.

Overrides FilterBase::__construct

File

src/Plugin/Filter/TokenFilter.php, line 78

Class

TokenFilter
Provides a filter that replaces global and entity tokens with their values.

Namespace

Drupal\token_filter\Plugin\Filter

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, Token $token, TokenEntityMapperInterface $token_entity_mapper, RendererInterface $renderer, RouteMatchInterface $current_route_match) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->token = $token;
  $this->tokenEntityMapper = $token_entity_mapper;
  $this->renderer = $renderer;
  $this->routeMatch = $current_route_match;
}