You are here

function _token_module in Token 8

Same name and namespace in other branches
  1. 7 token.module \_token_module()

Return the module responsible for a token.

Parameters

string $type: The token type.

string $name: The token name.

Return value

mixed The value of $info['tokens'][$type][$name]['module'] from token info, or NULL if the value does not exist.

2 calls to _token_module()
field_tokens in ./token.tokens.inc
Implements hook_tokens() on behalf of field.module.
token_tokens in ./token.tokens.inc
Implements hook_tokens().

File

./token.module, line 243
Enhances the token API in core: adds a browseable UI, missing tokens, etc.

Code

function _token_module($type, $name) {
  $token_info = \Drupal::token()
    ->getTokenInfo($type, $name);
  return isset($token_info['module']) ? $token_info['module'] : NULL;
}