public function Test::unEscapedScript in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/test_page_test/src/Controller/Test.php \Drupal\test_page_test\Controller\Test::unEscapedScript()
- 9 core/modules/system/tests/modules/test_page_test/src/Controller/Test.php \Drupal\test_page_test\Controller\Test::unEscapedScript()
File
- core/
modules/ system/ tests/ modules/ test_page_test/ src/ Controller/ Test.php, line 153
Class
- Test
- Defines a test controller for page titles.
Namespace
Drupal\test_page_test\ControllerCode
public function unEscapedScript() {
return [
'#prefix' => '<div class="unescaped">',
'#markup' => Markup::create("<script>alert('Marked safe');alert(\"Marked safe\");</script>"),
'#suffix' => '</div>',
];
}