Format.htmlspecialchars ViewHelper <f:format.htmlspecialchars>
Note
This reference is part of the documentation of Fluid Standalone. If you are working with Fluid in TYPO3 CMS, please refer to TYPO3's ViewHelper reference instead.
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>
Copied!
Output:
Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
Copied!
Inline notation
{text -> f:format.htmlspecialchars(encoding: 'ISO-8859-1')}
Copied!
Output:
Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied).
Copied!
Go to the source code of this ViewHelper: Format\HtmlspecialcharsViewHelper.php (GitHub).
Arguments
The following arguments are available for the format.htmlspecialchars ViewHelper:
doubleEncode
-
- Type
- boolean
- Default
- true
If false, html entities will not be encoded
encoding
-
- Type
- string
- Default
- 'UTF-8'
Encoding
keepQuotes
-
- Type
- boolean
- Default
- false
If true quotes will not be replaced (ENT_NOQUOTES)
value
-
- Type
- string
Value to format