public function TokensInfoEvent::addToken in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/core_event_dispatcher/src/Event/Token/TokensInfoEvent.php \Drupal\core_event_dispatcher\Event\Token\TokensInfoEvent::addToken()
Add token.
Parameters
\Drupal\core_event_dispatcher\ValueObject\Token $type: The token.
File
- modules/
core_event_dispatcher/ src/ Event/ Token/ TokensInfoEvent.php, line 51
Class
- TokensInfoEvent
- Class TokensInfoEvent.
Namespace
Drupal\core_event_dispatcher\Event\TokenCode
public function addToken(Token $type) : void {
$this->tokens[$type
->getType()][$type
->getToken()] = [
'name' => $type
->getName(),
'description' => $type
->getDescription(),
'dynamic' => $type
->isDynamic(),
];
}