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 anySimpleType

Outputs an JSON object rather than an array

ViewHelper Resources

Schema Resources