function Drupal::token
Same name and namespace in other branches
- 9 core/lib/Drupal.php \Drupal::token()
- 8.9.x core/lib/Drupal.php \Drupal::token()
- 11.x core/lib/Drupal.php \Drupal::token()
Returns the token service.
Return value
\Drupal\Core\Utility\Token The token service.
3 calls to Drupal::token()
- DrupalTest::testToken in core/
tests/ Drupal/ Tests/ Core/ DrupalTest.php - Tests the token() method.
- hook_tokens in core/
lib/ Drupal/ Core/ Utility/ token.api.php - Provide replacement values for placeholder tokens.
- TokenReplaceTest::testTaxonomyTokenReplacement in core/
modules/ taxonomy/ tests/ src/ Kernel/ TokenReplaceTest.php - Creates some terms and a node, then tests the tokens generated from them.
File
-
core/
lib/ Drupal.php, line 566
Class
- Drupal
- Static Service Container wrapper.
Code
public static function token() {
return static::getContainer()->get('token');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.