function LocaleTestHooks::tokenInfo

Implements hook_token_info().

Attributes

#[Hook('token_info')]

File

core/modules/locale/tests/modules/locale_test/src/Hook/LocaleTestHooks.php, line 179

Class

LocaleTestHooks
Hook implementations for locale_test.

Namespace

Drupal\locale_test\Hook

Code

public function tokenInfo() : array {
  $info = [];
  $info['types']['locale_test'] = [
    'name' => $this->t('Locale test'),
    'description' => $this->t('Locale test'),
  ];
  $info['tokens']['locale_test']['security_test1'] = [
    'type' => 'text',
    'name' => $this->t('Security test 1'),
  ];
  $info['tokens']['locale_test']['security_test2'] = [
    'type' => 'text',
    'name' => $this->t('Security test 2'),
  ];
  return $info;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.