Fully Qualified Name: | Laminas\View\Model\JsonModel |
Extends: | ViewModel |
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 |
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
Constructor
Parameter Name | Type | Description |
---|---|---|
$variables | null|array|\Traversable | |
$options | array|\Traversable |
Returns:
Property overloading: get variable value
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: mixed
Property overloading: do we have the requested variable value?
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: bool
Property overloading: set variable value
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Returns: void
Property overloading: unset the requested variable
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: void
Add a child model
Parameter Name | Type | Description |
---|---|---|
$child | \ModelInterface | |
$captureTo | null|string | Optional; |
$append | null|bool | Optional; |
Returns: \ViewModel
Get the name of the variable to which to capture this model
Returns: string
Clears out all child models
Returns: \ViewModel
Clear any existing renderer options/hints
Returns: \ViewModel
Clear all variables
Resets the internal variable container to an empty container.
Returns: \ViewModel
Return count of children
Returns: int
Return all children.
Return specifies an array, but may be any iterable object.
Returns: array
Returns an array of Viewmodels with captureTo value $capture
Parameter Name | Type | Description |
---|---|---|
$capture | string | |
$recursive | bool | search |
Returns: array
Get iterator of children
Returns: \ArrayIterator
Get a single option
Parameter Name | Type | Description |
---|---|---|
$name | string | The |
$default | mixed|null | (optional) |
Returns: mixed
Get renderer options/hints
Returns: array
Get the template to be used by this model
Returns: string
Get a single view variable
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$default | mixed|null | (optional) |
Returns: mixed
Get view variables
Returns: array|\ArrayAccess|\Traversable
Does the model have any children?
Returns: bool
Is this append to child with the same capture?
Returns: bool
Serialize to JSON
Returns: string
Set flag indicating whether or not append to child with the same capture
Parameter Name | Type | Description |
---|---|---|
$append | bool |
Returns: \ViewModel
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
Set the JSONP callback function name
Parameter Name | Type | Description |
---|---|---|
$callback | string |
Returns: \JsonModel
Set a single option
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Returns: \ViewModel
Set renderer options/hints en masse
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable |
Returns: \ViewModel
Set the template to be used by this model
Parameter Name | Type | Description |
---|---|---|
$template | string |
Returns: \ViewModel
Set flag indicating whether or not this is considered a terminal or standalone model
Parameter Name | Type | Description |
---|---|---|
$terminate | bool |
Returns: \ViewModel
Set view variable
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Returns: \ViewModel
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
Is this considered a terminal or standalone model?
Returns: bool