HtmlViewHelper extends AbstractViewHelper

ViewHelper

This class is the implementation of a Fluid ViewHelper.

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

FinalYes

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()  : void
render()  : string
createInitiator()  : SanitizerInitiator
createSanitizer()  : Sanitizer

Properties

$escapeChildren

protected bool $escapeChildren = false

$escapeOutput

protected bool $escapeOutput = false

Methods

initializeArguments()

public initializeArguments() : void

render()

public render() : string
Return values
string

createSanitizer()

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

        
On this page

Search results