public static function Drupal::token

Returns the token service.

Return value

\Drupal\Core\Utility\Token The token service.

20 calls to Drupal::token()
CommentTokenReplaceTest::testCommentTokenReplacement in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
Creates a comment, then tests the tokens generated from it.
comment_tokens in drupal/core/modules/comment/comment.tokens.inc
Implements hook_tokens().
FileTokenReplaceTest::testFileTokenReplacement in drupal/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
Creates a file, then tests the tokens generated from it.
hook_tokens in drupal/core/modules/system/system.api.php
Provide replacement values for placeholder tokens.
NodeTokenReplaceTest::testNodeTokenReplacement in drupal/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
Creates a node, then tests the tokens generated from it.

... See full list

File

drupal/core/lib/Drupal.php, line 360
Contains Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function token() {
  return static::$container
    ->get('token');
}