Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/Markup.php \Drupal\Core\Render\Markup
  2. 9 core/lib/Drupal/Core/Render/Markup.php \Drupal\Core\Render\Markup

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

This object should only be constructed with a known safe string. If there is any risk that the string contains user-entered data that has not been filtered first, it must not be used.

@internal This object is marked as internal because it should only be used whilst rendering.

Hierarchy

Expanded class hierarchy of Markup

See also

\Drupal\Core\Template\TwigExtension::escapeFilter

\Twig\Markup

26 files declare their use of Markup
AttributeTest.php in core/tests/Drupal/Tests/Core/Template/AttributeTest.php
ConfigTest.php in core/tests/Drupal/Tests/Core/Config/ConfigTest.php
EngineTwigTest.php in core/modules/system/tests/src/Functional/Theme/EngineTwigTest.php
errors.inc in core/includes/errors.inc
Functions for error handling.
FieldPluginBaseTest.php in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php

... See full list

2 string references to 'Markup'
AjaxRendererTest::setUp in core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php
views.field.schema.yml in core/modules/views/config/schema/views.field.schema.yml
core/modules/views/config/schema/views.field.schema.yml

File

core/lib/Drupal/Core/Render/Markup.php, line 22

Namespace

Drupal\Core\Render
View source
final class Markup implements MarkupInterface, \Countable {
  use MarkupTrait;

}

Members

Namesort descending Modifiers Type Description Overrides
MarkupTrait::$string protected property The safe string.
MarkupTrait::count public function
MarkupTrait::create public static function Creates a Markup object if necessary. 2
MarkupTrait::jsonSerialize public function
MarkupTrait::__toString public function Returns the string version of the Markup object.