Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 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 v11 here: TYPO3 ELTS.
Format.htmlspecialchars ViewHelper <f:format.htmlspecialchars>
Applies PHP htmlspecialchars()
escaping to a value.
See http://www.php.net/manual/function.htmlspecialchars.php
Examples
Default notation
<f:format.htmlspecialchars>{text}</f:format.htmlspecialchars>
Output:
Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
Inline notation
{text -> f:format.htmlspecialchars(encoding: 'ISO-8859-1')}
Output:
Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
Source code
Go to the source code of this ViewHelper: HtmlspecialcharsViewHelper.php (GitHub).
Arguments
The following arguments are available for <f:
:
value
-
- Type
- string
Value to format
keepQuotes
-
- Type
- boolean
If TRUE quotes will not be replaced (ENT_NOQUOTES)
encoding
-
- Type
- string
- Default
'UTF-
8'
Encoding
doubleEncode
-
- Type
- boolean
- Default
true
If FALSE html entities will not be encoded