You are here

public function TokensInfoEvent::getTokens in Hook Event Dispatcher 8

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

src/Event/Token/TokensInfoEvent.php, line 103

Class

TokensInfoEvent
Class TokensInfoEvent.

Namespace

Drupal\hook_event_dispatcher\Event\Token

Code

public function getTokens() {
  return $this->tokens;
}