Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Token.php

function Token::replacePlain

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 209

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal