JsonRenderer

JSON renderer
implements Zend\View\Renderer\RendererInterface , Zend\View\Renderer\TreeRendererInterface

Known subclasses

Omeka\View\Renderer\ApiJsonRenderer
Methods Summary
public
# 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.

Implementation of

public
# setResolver( Zend\View\Resolver\ResolverInterface $resolver )
Set the resolver used to map a template name to a resource the renderer may consume.

todo


Implementation of

public
# setMergeUnnamedChildren( bool $mergeUnnamedChildren )
Set flag indicating whether or not to merge unnamed children
public
# setJsonpCallback( string $callback )
Set the JSONP callback function name
public
# hasJsonpCallback( )
Returns whether or not the jsonpCallback has been set
public
# mergeUnnamedChildren( )
Should we merge unnamed children?
public
# render( string|\Model $nameOrModel , null|array|\ArrayAccess $values = NULL )
Renders values as JSON

todo


Implementation of

public
# canRenderTrees( )
Can this renderer render trees of view models? Yes.

Implementation of

protected
# recurseModel( Zend\View\Model\ModelInterface $model , bool $mergeWithVariables = true )
Retrieve values from a model and recurse its children to build a data structure
protected
# injectChildren( Zend\View\Model\ModelInterface $model , array $children )
Inject discovered child model values into parent model

todo


Properties Summary
protected bool $mergeUnnamedChildren
Whether or not to merge child models with no capture-to value set
# false
protected Zend\View\Resolver\ResolverInterface $resolver
# NULL
protected string $jsonpCallback
JSONP callback (if set, wraps the return in a function call)
# NULL