You are here

protected static function FormattableMarkup::placeholderEscape in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Render/FormattableMarkup.php \Drupal\Component\Render\FormattableMarkup::placeholderEscape()
  2. 9 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.

File

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

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