function FormattableMarkup::placeholderEscape

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

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.