17 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
18 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderStatic;
51 use CompileWithContentArgumentAndRenderStatic;
72 parent::initializeArguments();
73 $this->registerArgument(
'value',
'string',
'string to format');
74 $this->registerArgument(
'keepQuotes',
'bool',
'If TRUE, single and double quotes won\'t be replaced (sets ENT_NOQUOTES flag).',
false,
false);
75 $this->registerArgument(
'encoding',
'string',
'');
88 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
90 $value = $renderChildrenClosure();
91 $encoding = $arguments[
'encoding'];
92 $keepQuotes = $arguments[
'keepQuotes'];
94 if (!is_string($value)) {
97 if ($encoding ===
null) {
100 $flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
101 return html_entity_decode($value, $flags, $encoding);