final class FieldFilteredMarkup implements MarkupInterface, Countable (View source)

internal  This object is marked as internal because it should only be used by the Field module and field-related plugins.
 

Defines an object that passes safe strings through the Field system.

This object filters the string using a very restrictive tag list when it is created.

Traits

Implements MarkupInterface and Countable for rendered objects.

Properties

protected string $string

The safe string.

from  MarkupTrait

Methods

static string|MarkupInterface
create($string)

Overrides \Drupal\Component\Render\MarkupTrait::create().

string
__toString()

Returns the string version of the Markup object.

int
count()

Returns the string length.

string
jsonSerialize()

Returns a representation of the object for use in JSON serialization.

static string[]
allowedTags()

Returns the allowed tag list.

static string
displayAllowedTags()

Returns a human-readable list of allowed tags for display in help texts.

Details

static string|MarkupInterface create($string)

Overrides \Drupal\Component\Render\MarkupTrait::create().

Parameters

$string

Return Value

string|MarkupInterface

A safe string filtered with the allowed tag list and normalized.

See also

FieldFilteredMarkup::allowedTags
Xss::filter
Html::normalize

string __toString()

Returns the string version of the Markup object.

Return Value

string

The safe string content.

int count()

Returns the string length.

Return Value

int

The length of the string.

string jsonSerialize()

Returns a representation of the object for use in JSON serialization.

Return Value

string

The safe string content.

static string[] allowedTags()

Returns the allowed tag list.

Return Value

string[]

A list of allowed tags.

static string displayAllowedTags()

Returns a human-readable list of allowed tags for display in help texts.

Return Value

string

A human-readable list of allowed tags for display in help texts.