Package

ViewHelpers

ViewHelper Documentation

format.json

Wrapper for PHPs json_encode function.

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

Arguments

value anySimpleType

The incoming data to convert, or NULL if VH children should be used

forceObject boolean

Outputs an JSON object rather than an array

ViewHelper Resources

Schema Resources