Attention

TYPO3 v9 has reached its end-of-life September 30th, 2021 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.

You can order Extended Long Term Support (ELTS) 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