HtmlentitiesDecodeViewHelper extends AbstractEncodingViewHelper uses CompileWithContentArgumentAndRenderStatic

FinalYes

Applies :php:`html_entity_decode()` to a value.

See https://www.php.net/html_entity_decode.

Examples

Default notation

::

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

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

Inline notation

::

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

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

But encoded as ISO-8859-1.

Table of Contents

Properties

$defaultEncoding  : string
$escapeChildren  : bool
We accept value and children interchangeably, thus we must disable children escaping.
$escapeOutput  : bool
If we decode, we must not encode again after that.

Methods

initializeArguments()  : void
renderStatic()  : mixed
Converts all HTML entities to their applicable characters as needed using PHPs html_entity_decode() function.
resolveContentArgumentName()  : string
Explicitly set argument name to be used as content.
resolveDefaultEncoding()  : string
Resolve the default encoding. If none is set in Frontend or Backend, uses UTF-8.

Properties

$defaultEncoding

protected static string $defaultEncoding

$escapeChildren

We accept value and children interchangeably, thus we must disable children escaping.

protected bool $escapeChildren = false

$escapeOutput

If we decode, we must not encode again after that.

protected bool $escapeOutput = false

Methods

initializeArguments()

public initializeArguments() : void

renderStatic()

Converts all HTML entities to their applicable characters as needed using PHPs html_entity_decode() function.

public static renderStatic(array<string|int, mixed> $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : mixed
Parameters
$arguments : array<string|int, mixed>
$renderChildrenClosure : Closure
$renderingContext : RenderingContextInterface
Tags
see
https://www.php.net/html_entity_decode

resolveContentArgumentName()

Explicitly set argument name to be used as content.

public resolveContentArgumentName() : string
Return values
string

resolveDefaultEncoding()

Resolve the default encoding. If none is set in Frontend or Backend, uses UTF-8.

protected static resolveDefaultEncoding() : string
Return values
string

        
On this page

Search results