class HtmlEscapedText implements MarkupInterface, Countable (View source)

Escapes HTML syntax characters to HTML entities for display in markup.

This class can be used to provide theme engine-like late escaping functionality.

Properties

protected string $string

The string to escape.

Methods

__construct($string)

Constructs an HtmlEscapedText object.

string
__toString()

Returns markup.

count()

{@inheritdoc}

jsonSerialize()

{@inheritdoc}

Details

__construct($string)

Constructs an HtmlEscapedText object.

Parameters

$string

The string to escape. This value will be cast to a string.

string __toString()

Returns markup.

Return Value

string

The markup.

count()

{@inheritdoc}

jsonSerialize()

{@inheritdoc}