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>
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!

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