Token.php in Flexiform 8
File
src/Utility/Token.php
View source
<?php
namespace Drupal\flexiform\Utility;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Utility\Token as CoreToken;
class Token extends CoreToken {
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);
}
}
}
Classes
Name |
Description |
Token |
Provides token integration. |