Class JsonModel

Summary

Fully Qualified Name: Zend\View\Model\JsonModel
Extends: ViewModel

Description

Methods

Name Description Defined By
__clone() Called after this view model is cloned. ViewModel
__construct() Constructor ViewModel
__get() Property overloading: get variable value ViewModel
__isset() Property overloading: do we have the requested variable value? ViewModel
__set() Property overloading: set variable value ViewModel
__unset() Property overloading: unset the requested variable ViewModel
addChild() Add a child model ViewModel
captureTo() Get the name of the variable to which to capture this model ViewModel
clearChildren() Clears out all child models ViewModel
clearOptions() Clear any existing renderer options/hints ViewModel
clearVariables() Clear all variables ViewModel
count() Return count of children ViewModel
getChildren() Return all children. ViewModel
getChildrenByCaptureTo() Returns an array of Viewmodels with captureTo value $capture ViewModel
getIterator() Get iterator of children ViewModel
getOption() Get a single option ViewModel
getOptions() Get renderer options/hints ViewModel
getTemplate() Get the template to be used by this model ViewModel
getVariable() Get a single view variable ViewModel
getVariables() Get view variables ViewModel
hasChildren() Does the model have any children? ViewModel
isAppend() Is this append to child with the same capture? ViewModel
serialize() Serialize to JSON JsonModel
setAppend() Set flag indicating whether or not append to child with the same capture ViewModel
setCaptureTo() Set the name of the variable to capture this model to, if it is a child model ViewModel
setJsonpCallback() Set the JSONP callback function name JsonModel
setOption() Set a single option ViewModel
setOptions() Set renderer options/hints en masse ViewModel
setTemplate() Set the template to be used by this model ViewModel
setTerminal() Set flag indicating whether or not this is considered a terminal or standalone model ViewModel
setVariable() Set view variable ViewModel
setVariables() Set view variables en masse ViewModel
terminate() Is this considered a terminal or standalone model? ViewModel

Method Details

__clone()

Called after this view model is cloned.

Clones $variables property so changes done to variables in the new instance don't change the current one.

Returns: void

__construct()

Constructor

Parameter Name Type Description
$variables null|array|\Traversable
$options array|\Traversable

Returns:

__get()

Property overloading: get variable value

Parameter Name Type Description
$name string

Returns: mixed

__isset()

Property overloading: do we have the requested variable value?

Parameter Name Type Description
$name string

Returns: bool

__set()

Property overloading: set variable value

Parameter Name Type Description
$name string
$value mixed

Returns: void

__unset()

Property overloading: unset the requested variable

Parameter Name Type Description
$name string

Returns: void

addChild()

Add a child model

Parameter Name Type Description
$child \ModelInterface
$captureTo null|string Optional;
$append null|bool Optional;

Returns: \ViewModel

captureTo()

Get the name of the variable to which to capture this model

Returns: string

clearChildren()

Clears out all child models

Returns: \ViewModel

clearOptions()

Clear any existing renderer options/hints

Returns: \ViewModel

clearVariables()

Clear all variables

Resets the internal variable container to an empty container.

Returns: \ViewModel

count()

Return count of children

Returns: int

getChildren()

Return all children.

Return specifies an array, but may be any iterable object.

Returns: array

getChildrenByCaptureTo()

Returns an array of Viewmodels with captureTo value $capture

Parameter Name Type Description
$capture string
$recursive bool search

Returns: array

getIterator()

Get iterator of children

Returns: \ArrayIterator

getOption()

Get a single option

Parameter Name Type Description
$name string The
$default mixed|null (optional)

Returns: mixed

getOptions()

Get renderer options/hints

Returns: array

getTemplate()

Get the template to be used by this model

Returns: string

getVariable()

Get a single view variable

Parameter Name Type Description
$name string
$default mixed|null (optional)

Returns: mixed

getVariables()

Get view variables

Returns: array|\ArrayAccess|\Traversable

hasChildren()

Does the model have any children?

Returns: bool

isAppend()

Is this append to child with the same capture?

Returns: bool

serialize()

Serialize to JSON

Returns: string

setAppend()

Set flag indicating whether or not append to child with the same capture

Parameter Name Type Description
$append bool

Returns: \ViewModel

setCaptureTo()

Set the name of the variable to capture this model to, if it is a child model

Parameter Name Type Description
$capture string

Returns: \ViewModel

setJsonpCallback()

Set the JSONP callback function name

Parameter Name Type Description
$callback string

Returns: \JsonModel

setOption()

Set a single option

Parameter Name Type Description
$name string
$value mixed

Returns: \ViewModel

setOptions()

Set renderer options/hints en masse

Parameter Name Type Description
$options array|\Traversable

Returns: \ViewModel

setTemplate()

Set the template to be used by this model

Parameter Name Type Description
$template string

Returns: \ViewModel

setTerminal()

Set flag indicating whether or not this is considered a terminal or standalone model

Parameter Name Type Description
$terminate bool

Returns: \ViewModel

setVariable()

Set view variable

Parameter Name Type Description
$name string
$value mixed

Returns: \ViewModel

setVariables()

Set view variables en masse

Can be an array or a Traversable + ArrayAccess object.

Parameter Name Type Description
$variables array|\ArrayAccess|\Traversable
$overwrite bool Whether

Returns: \ViewModel

terminate()

Is this considered a terminal or standalone model?

Returns: bool

Top