Class JsonRenderer

Summary

Fully Qualified Name: Laminas\View\Renderer\JsonRenderer
Implements: RendererInterface, TreeRendererInterface

Description

JSON renderer

Methods

Name Description Defined By
canRenderTrees() Can this renderer render trees of view models? JsonRenderer
getEngine() Return the template engine object, if any JsonRenderer
hasJsonpCallback() Returns whether or not the jsonpCallback has been set JsonRenderer
mergeUnnamedChildren() Should we merge unnamed children? JsonRenderer
render() Renders values as JSON JsonRenderer
setJsonpCallback() Set the JSONP callback function name JsonRenderer
setMergeUnnamedChildren() Set flag indicating whether or not to merge unnamed children JsonRenderer
setResolver() Set the resolver used to map a template name to a resource the renderer may consume. JsonRenderer

Method Details

canRenderTrees()

Can this renderer render trees of view models?

Yes.

Returns: bool

getEngine()

Return the template engine object, if any

If using a third-party template engine, such as Smarty, patTemplate, phplib, etc, return the template engine object. Useful for calling methods on these objects, such as for setting filters, modifiers, etc.

Returns: mixed

hasJsonpCallback()

Returns whether or not the jsonpCallback has been set

Returns: bool

mergeUnnamedChildren()

Should we merge unnamed children?

Returns: bool

render()

Renders values as JSON

Parameter Name Type Description
$nameOrModel string|\Model The
$values null|array|\ArrayAccess Values

Returns: string The script output.

setJsonpCallback()

Set the JSONP callback function name

Parameter Name Type Description
$callback string

Returns: \JsonRenderer

setMergeUnnamedChildren()

Set flag indicating whether or not to merge unnamed children

Parameter Name Type Description
$mergeUnnamedChildren bool

Returns: \JsonRenderer

setResolver()

Set the resolver used to map a template name to a resource the renderer may consume.

Parameter Name Type Description
$resolver \Resolver

Returns: \Renderer

Top