class Token in Flexiform 8
Provides token integration.
Hierarchy
Expanded class hierarchy of Token
4 files declare their use of Token
- CustomTextComponent.php in src/
Plugin/ FormComponentType/ CustomTextComponent.php - CustomTextComponentType.php in src/
Plugin/ FormComponentType/ CustomTextComponentType.php - FlexiformController.php in src/
Controller/ FlexiformController.php - SubmitButtonRedirect.php in src/
Plugin/ FormEnhancer/ SubmitButtonRedirect.php
1 string reference to 'Token'
1 service uses Token
File
- src/
Utility/ Token.php, line 11
Namespace
Drupal\flexiform\UtilityView source
class Token extends CoreToken {
/**
* {@inheritdoc}
*
* Additionally this allows the user to supply aliases into options to allow
* more than one of a given type of token.
*/
public function generate($type, array $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
if (!empty($options['alias'][$type])) {
$unaliased_data = [
$options['alias'][$type] => $data[$type],
] + $data;
return parent::generate($options['alias'][$type], $tokens, $unaliased_data, $options, $bubbleable_metadata);
}
else {
return parent::generate($type, $tokens, $data, $options, $bubbleable_metadata);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Token:: |
protected | property | The token cache. | |
Token:: |
protected | property | The cache tags invalidator. | |
Token:: |
protected | property | The language manager. | |
Token:: |
protected | property | The module handler service. | |
Token:: |
protected | property | The renderer. | |
Token:: |
protected | property | Token definitions. | |
Token:: |
public | function | Returns a list of tokens that begin with a specific prefix. | |
Token:: |
public | function |
Additionally this allows the user to supply aliases into options to allow
more than one of a given type of token. Overrides Token:: |
|
Token:: |
public | function | Returns metadata describing supported tokens. | |
Token:: |
public | function | Replaces all tokens in a given string with appropriate values. | |
Token:: |
public | function | Resets metadata describing supported tokens. | |
Token:: |
public | function | Builds a list of all token-like patterns that appear in the text. | |
Token:: |
public | function | Sets metadata describing supported tokens. | |
Token:: |
constant | The tag to cache token info with. | ||
Token:: |
public | function | Constructs a new class instance. |