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.htmlentities

Applies htmlentities() escaping to a value. See https://www.php.net/manual/function.htmlentities.php.

Examples

Default notation

<f:format.htmlentities>{text}</f:format.htmlentities>

Text containing the following signs & " ' < > will be processed by htmlentities(). These will result in: &amp; &quot; &#039; &lt; &gt;.

Inline notation

{text -> f:format.htmlentities(encoding: 'ISO-8859-1')}

Text containing the following signs & " ' < > will be processed by htmlentities(). These will result in: &amp; &quot; &#039; &lt; &gt;.

But encoded as ISO-8859-1.

Arguments

value

DataType

string

Required

false

Description

String to format

keepQuotes

DataType

mixed

Required

false

Description

If TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag).

encoding

DataType

string

Required

false

Description

doubleEncode

DataType

mixed

Default

true

Required

false

Description

If FALSE existing html entities won't be encoded, the default is to convert everything.