You are here

protected static function FormattableMarkup::placeholderEscape in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Render/FormattableMarkup.php \Drupal\Component\Render\FormattableMarkup::placeholderEscape()
  2. 10 core/lib/Drupal/Component/Render/FormattableMarkup.php \Drupal\Component\Render\FormattableMarkup::placeholderEscape()

Escapes a placeholder replacement value if needed.

Parameters

string|\Drupal\Component\Render\MarkupInterface $value: A placeholder replacement value.

Return value

string The properly escaped replacement value.

1 call to FormattableMarkup::placeholderEscape()
FormattableMarkup::placeholderFormat in core/lib/Drupal/Component/Render/FormattableMarkup.php
Replaces placeholders in a string with values.

File

core/lib/Drupal/Component/Render/FormattableMarkup.php, line 259

Class

FormattableMarkup
Formats a string for HTML display by replacing variable placeholders.

Namespace

Drupal\Component\Render

Code

protected static function placeholderEscape($value) {
  return $value instanceof MarkupInterface ? (string) $value : Html::escape($value);
}