Neos\FluidAdaptor\ViewHelpers\Format\JsonViewHelper::renderStatic PHP Méthode

renderStatic() public static méthode

Applies json_encode() on the specified value.
public static renderStatic ( array $arguments, Closure $renderChildrenClosure, TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext ) : string
$arguments array
$renderChildrenClosure Closure
$renderingContext TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface
Résultat string
    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
    {
        $value = $arguments['value'];
        if ($value === null) {
            $value = $renderChildrenClosure();
        }
        $options = JSON_HEX_TAG;
        if ($arguments['forceObject'] !== false) {
            $options = $options | JSON_FORCE_OBJECT;
        }
        return json_encode($value, $options);
    }