public function render()
    {
        $value = $this->arguments['value'];

        if ($value === null) {
            $value = $this->renderChildren();
        }
        $options = JSON_HEX_TAG;
        if ($this->arguments['forceObject'] !== false) {
            $options = $options | JSON_FORCE_OBJECT;
        }

        return json_encode($value, $options);
    }
public function render()
    {
        $value = $this->arguments['value'];

        if ($value === null) {
            $value = $this->renderChildren();
        }
        $options = JSON_HEX_TAG;
        if ($this->arguments['forceObject'] !== false) {
            $options = $options | JSON_FORCE_OBJECT;
        }

        return json_encode($value, $options);
    }
public function render ( ) { $ value = $ this -> arguments [ 'value' ] ; if ( $ value === null ) { $ value = $ this -> renderChildren ( ) ; } $ options = JSON_HEX_TAG ; if ( $ this -> arguments [ 'forceObject' ] !== false ) { $ options = $ options | JSON_FORCE_OBJECT ; } return json_encode ( $ value , $ options ) ; }
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.

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"}

@return string the JSON-encoded string.
@see http://www.php.net/manual/en/function.json-encode.php
@api
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 .