PHP Класс Neos\FluidAdaptor\ViewHelpers\Format\JsonViewHelper

= Examples = {someArray -> f:format.json()} ["array","values"] depending on the value of {someArray} {f:format.json(value: {foo: 'bar', bar: 'baz'})} {"foo":"bar","bar":"baz"} {f:format.json(value: {0: 'bar', 1: 'baz'}, forceObject: true)} {"0":"bar","1":"baz"}
Наследование: extends Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$escapeChildren boolean

Открытые методы

Метод Описание
render ( mixed $value = null, boolean $forceObject = false ) : string Outputs content with its JSON representation. To prevent issues in HTML context, occurrences of greater-than or less-than characters are converted to their hexadecimal representations.
renderStatic ( array $arguments, Closure $renderChildrenClosure, TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext ) : string Applies json_encode() on the specified value.

Описание методов

render() публичный Метод

If $forceObject is TRUE a JSON object is outputted even if the value is a non-associative array Example: array('foo', 'bar') as input will not be ["foo","bar"] but {"0":"foo","1":"bar"}
См. также: http://www.php.net/manual/en/function.json-encode.php
public render ( mixed $value = null, boolean $forceObject = false ) : string
$value mixed The incoming data to convert, or NULL if VH children should be used
$forceObject boolean Outputs an JSON object rather than an array
Результат string the JSON-encoded string.

renderStatic() публичный статический Метод

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
Результат string

Описание свойств

$escapeChildren защищенное свойство

protected bool $escapeChildren
Результат boolean