public function DomainToken::getTokenInfo in Domain Access 8
Implements hook_token_info().
File
- domain/
src/ DomainToken.php, line 57
Class
- DomainToken
- Token handler for Domain.
Namespace
Drupal\domainCode
public function getTokenInfo() {
// Domain token types.
$info['types']['domain'] = [
'name' => $this
->t('Domains'),
'description' => $this
->t('Tokens related to domains.'),
'needs-data' => 'domain',
];
// These two types require the Token contrib module.
$info['types']['current-domain'] = [
'name' => $this
->t('Current domain'),
'description' => $this
->t('Tokens related to the current domain.'),
'type' => 'domain',
];
$info['types']['default-domain'] = [
'name' => $this
->t('Default domain'),
'description' => $this
->t('Tokens related to the default domain.'),
'type' => 'domain',
];
// Domain tokens.
$info['tokens']['domain']['id'] = [
'name' => $this
->t('Domain id'),
'description' => $this
->t("The domain's numeric ID."),
];
$info['tokens']['domain']['machine-name'] = [
'name' => $this
->t('Domain machine name'),
'description' => $this
->t('The domain machine identifier.'),
];
$info['tokens']['domain']['path'] = [
'name' => $this
->t('Domain path'),
'description' => $this
->t('The base URL for the domain.'),
];
$info['tokens']['domain']['name'] = [
'name' => $this
->t('Domain name'),
'description' => $this
->t('The domain name.'),
];
$info['tokens']['domain']['url'] = [
'name' => $this
->t('Domain URL'),
'description' => $this
->t("The domain's URL for the current page request."),
];
$info['tokens']['domain']['hostname'] = [
'name' => $this
->t('Domain hostname'),
'description' => $this
->t('The domain hostname.'),
];
$info['tokens']['domain']['scheme'] = [
'name' => $this
->t('Domain scheme'),
'description' => $this
->t('The domain scheme.'),
];
$info['tokens']['domain']['status'] = [
'name' => $this
->t('Domain status'),
'description' => $this
->t('The domain status.'),
];
$info['tokens']['domain']['weight'] = [
'name' => $this
->t('Domain weight'),
'description' => $this
->t('The domain weight.'),
];
$info['tokens']['domain']['is_default'] = [
'name' => $this
->t('Domain default'),
'description' => $this
->t('The domain is the default domain.'),
];
return $info;
}