function hook_event_dispatcher_token_info in Hook Event Dispatcher 8
Implements hook_token_info().
1 call to hook_event_dispatcher_token_info()
- TokenEventTest::testTokenInfoEvent in tests/
src/ Unit/ Token/ TokenEventTest.php - Test TokenInfoEvent.
File
- ./
hook_event_dispatcher.module, line 371 - Hook event dispatcher module.
Code
function hook_event_dispatcher_token_info() {
/** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
$manager = \Drupal::service('hook_event_dispatcher.manager');
$event = new TokensInfoEvent();
$manager
->register($event);
return [
'types' => $event
->getTokenTypes(),
'tokens' => $event
->getTokens(),
];
}