‪TYPO3CMS  11.5
TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper:
TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

static string renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 

Protected Attributes

bool $escapeChildren = false
 
bool $escapeOutput = false
 

Additional Inherited Members

- ‪Static Protected Member Functions inherited from ‪TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper
static string resolveDefaultEncoding ()
 
- ‪Static Protected Attributes inherited from ‪TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper
static string $defaultEncoding
 

Detailed Description

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: & " &#039; < >, 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: & " &#039; < >, will be processed by :php:html_entity_decode(). These will result in: & " ' < >.

But encoded as ISO-8859-1.

Definition at line 50 of file HtmlentitiesDecodeViewHelper.php.

Member Function Documentation

◆ initializeArguments()

TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper::initializeArguments ( )

Initialize ViewHelper arguments

Definition at line 68 of file HtmlentitiesDecodeViewHelper.php.

◆ renderStatic()

static string TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

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

See also
https://www.php.net/html_entity_decode
Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
‪string

Definition at line 86 of file HtmlentitiesDecodeViewHelper.php.

References TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper\resolveDefaultEncoding().

Member Data Documentation

◆ $escapeChildren

bool TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper::$escapeChildren = false
protected

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

Definition at line 57 of file HtmlentitiesDecodeViewHelper.php.

◆ $escapeOutput

bool TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlentitiesDecodeViewHelper::$escapeOutput = false
protected

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

Definition at line 63 of file HtmlentitiesDecodeViewHelper.php.