HtmlEscapedText.php in Drupal 9
File
core/lib/Drupal/Component/Render/HtmlEscapedText.php
View source
<?php
namespace Drupal\Component\Render;
use Drupal\Component\Utility\Html;
class HtmlEscapedText implements MarkupInterface, \Countable {
protected $string;
public function __construct($string) {
$this->string = (string) $string;
}
public function __toString() {
return Html::escape($this->string);
}
public function count() {
return mb_strlen($this->string);
}
public function jsonSerialize() {
return $this
->__toString();
}
}
Classes
Name |
Description |
HtmlEscapedText |
Escapes HTML syntax characters to HTML entities for display in markup. |