HtmlViewHelper extends AbstractViewHelper uses CompileWithRenderStatic

ViewHelper

This class is the implementation of a Fluid ViewHelper.

View this class in the TYPO3 ViewHelper reference: <f:sanitize.html>

Passes a given content through `typo3/html-sanitizer` to mitigate potential cross-site scripting occurrences. Given `default` build corresponds to class `TYPO3\CMS\Core\Html\DefaultSanitizerBuilder` declaring allowed HTML tags, attributes and their values.

Examples

Default parameters

::

<f:sanitize.html> </f:sanitize.html>

Output::

Inline notation

::

{richTextFieldContent -> f:sanitize.html(build: 'default')}

Table of Contents

Properties

$escapeChildren  : bool
$escapeOutput  : bool

Methods

initializeArguments()  : mixed
renderStatic()  : string
createInitiator()  : SanitizerInitiator
createSanitizer()  : Sanitizer

Properties

$escapeChildren

protected bool $escapeChildren = false

$escapeOutput

protected bool $escapeOutput = false

Methods

initializeArguments()

public initializeArguments() : mixed
Tags
throws
Exception

renderStatic()

public static renderStatic(array{build: string|class-string} $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : string
Parameters
$arguments : array{build: string|class-string}
$renderChildrenClosure : Closure
$renderingContext : RenderingContextInterface
Return values
string

the parsed string.

createSanitizer()

protected static createSanitizer(string $build) : Sanitizer
Parameters
$build : string
Return values
Sanitizer

        
On this page

Search results