Attention

TYPO3 v10 has reached end-of-life as of April 30th 2023 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.

Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.

format.htmlspecialchars

Applies htmlspecialchars() escaping to a value

= Examples =

<code title="default notation"> <f:format.htmlspecialchars>{text}</f:format.htmlspecialchars> </code> <output> Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied). </output>

<code title="inline notation"> {text -> f:format.htmlspecialchars(encoding: 'ISO-8859-1')} </code> <output> Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied). </output>

Arguments

value

DataType

string

Required

false

Description

Value to format

keepQuotes

DataType

boolean

Required

false

Description

If TRUE quotes will not be replaced (ENT_NOQUOTES)

encoding

DataType

string

Default

'UTF-8'

Required

false

Description

Encoding

doubleEncode

DataType

boolean

Default

true

Required

false

Description

If FALSE html entities will not be encoded