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
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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