public function TokensInfoEvent::getTokens 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::getTokens()
Getter.
An associative array of tokens. The outer array is keyed by the group name (the same key as in the types array). Within each group of tokens, each token item is keyed by the machine name of the token, and each token item has the following components:
- name: The translated human-readable short name of the token.
- description (optional): A translated longer description of the token.
- type (optional): A 'needs-data' data type supplied by this token, which should match a 'needs-data' value from another token type. For example, the node author token provides a user object, which can then be used for token replacement data in \Drupal\Core\Utility\Token::replace() without having to supply a separate user object.
Return value
array The tokens.
File
- modules/
core_event_dispatcher/ src/ Event/ Token/ TokensInfoEvent.php, line 103
Class
- TokensInfoEvent
- Class TokensInfoEvent.
Namespace
Drupal\core_event_dispatcher\Event\TokenCode
public function getTokens() : array {
return $this->tokens;
}