You are here

public function Token::replacePlain in Drupal 10

Replaces all tokens in a given plain text string with appropriate values.

Parameters

string $plain: Plain text string.

array $data: (optional) An array of keyed objects. See replace().

array $options: (optional) A keyed array of options. See replace().

\Drupal\Core\Render\BubbleableMetadata|null $bubbleable_metadata: (optional) Target for adding metadata. See replace().

Return value

string The entered plain text with tokens replaced.

File

core/lib/Drupal/Core/Utility/Token.php, line 207

Class

Token
Drupal placeholder/token replacement system.

Namespace

Drupal\Core\Utility

Code

public function replacePlain(string $plain, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) : string {
  return $this
    ->doReplace(FALSE, $plain, $data, $options, $bubbleable_metadata);
}