package Default
inherited_from \Zend\View\Model\ViewModel

 Methods

Constructor

__construct(null|array|\Traversable $variables = null, array|\Traversable $options = null
Inherited

Parameters

$variables

nullarray\Traversable

$options

array\Traversable

Property overloading: get variable value

__get(string $name) : mixed
Inherited

Parameters

$name

string

Returns

mixed

Property overloading: do we have the requested variable value?

__isset(string $name) : boolean
Inherited

Parameters

$name

string

Returns

boolean

Property overloading: set variable value

__set(string $name, mixed $value) : void
Inherited

Parameters

$name

string

$value

mixed

Property overloading: unset the requested variable

__unset(string $name) : void
Inherited

Parameters

$name

string

Add a child model

addChild(\Zend\View\Model\ModelInterface $child, null|string $captureTo = null, null|boolean $append = null) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::addChild()

Parameters

$child

\Zend\View\Model\ModelInterface

$captureTo

nullstring

Optional; if specified, the "capture to" value to set on the child

$append

nullboolean

Optional; if specified, append to child with the same capture

Returns

\Zend\View\Model\ViewModel

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

captureTo() : string
Inherited
inherited_from \Zend\View\Model\ModelInterface::captureTo()

Returns

string

Clears out all child models

clearChildren() : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ClearableModelInterface::clearChildren()

Returns

\Zend\View\Model\ViewModel

Clear any existing renderer options/hints

clearOptions() : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ClearableModelInterface::clearOptions()

Returns

\Zend\View\Model\ViewModel

Clear all variables

clearVariables() : \Zend\View\Model\ViewModel
Inherited

Resets the internal variable container to an empty container.

inherited_from \Zend\View\Model\ClearableModelInterface::clearVariables()

Returns

\Zend\View\Model\ViewModel

Return count of children

count() : integer
Inherited

Returns

integer

Return all children.

getChildren() : array
Inherited

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

inherited_from \Zend\View\Model\ModelInterface::getChildren()

Returns

array

Returns an array of Viewmodels with captureTo value $capture

getChildrenByCaptureTo(string $capture, boolean $recursive = true) : array
Inherited
inherited_from \Zend\View\Model\RetrievableChildrenInterface::getChildrenByCaptureTo()

Parameters

$capture

string

$recursive

boolean

search recursive through children, default true

Returns

array

Get iterator of children

getIterator() : \ArrayIterator
Inherited

Returns

\ArrayIterator

Get a single option

getOption(string $name, mixed|null $default = null) : mixed
Inherited

Parameters

$name

string

The option to get.

$default

mixednull

(optional) A default value if the option is not yet set.

Returns

mixed

Get renderer options/hints

getOptions() : array
Inherited
inherited_from \Zend\View\Model\ModelInterface::getOptions()

Returns

array

Get the template to be used by this model

getTemplate() : string
Inherited
inherited_from \Zend\View\Model\ModelInterface::getTemplate()

Returns

string

Get a single view variable

getVariable(string $name, mixed|null $default = null) : mixed
Inherited
inherited_from \Zend\View\Model\ModelInterface::getVariable()

Parameters

$name

string

$default

mixednull

(optional) default value if the variable is not present.

Returns

mixed

Get view variables

getVariables() : array | \ArrayAccess | \Traversable
Inherited
inherited_from \Zend\View\Model\ModelInterface::getVariables()

Returns

array\ArrayAccess\Traversable

Does the model have any children?

hasChildren() : boolean
Inherited
inherited_from \Zend\View\Model\ModelInterface::hasChildren()

Returns

boolean

Is this append to child with the same capture?

isAppend() : boolean
Inherited
inherited_from \Zend\View\Model\ModelInterface::isAppend()

Returns

boolean

Serialize to JSON

serialize() : string

Returns

string

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

setAppend(boolean $append) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setAppend()

Parameters

$append

boolean

Returns

\Zend\View\Model\ViewModel

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

setCaptureTo(string $capture) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setCaptureTo()

Parameters

$capture

string

Returns

\Zend\View\Model\ViewModel

Set the JSONP callback function name

setJsonpCallback(string $callback) : \Zend\View\Model\JsonModel

Parameters

$callback

string

Returns

\Zend\View\Model\JsonModel

Set a single option

setOption(string $name, mixed $value) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setOption()

Parameters

$name

string

$value

mixed

Returns

\Zend\View\Model\ViewModel

Set renderer options/hints en masse

setOptions(array|\Traversable $options) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setOptions()

Parameters

$options

array\Traversable

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

\Zend\View\Model\ViewModel

Set the template to be used by this model

setTemplate(string $template) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setTemplate()

Parameters

$template

string

Returns

\Zend\View\Model\ViewModel

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

setTerminal(boolean $terminate) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setTerminal()

Parameters

$terminate

boolean

Returns

\Zend\View\Model\ViewModel

Set view variable

setVariable(string $name, mixed $value) : \Zend\View\Model\ViewModel
Inherited
inherited_from \Zend\View\Model\ModelInterface::setVariable()

Parameters

$name

string

$value

mixed

Returns

\Zend\View\Model\ViewModel

Set view variables en masse

setVariables(array|\ArrayAccess|\Traversable $variables, boolean $overwrite = false) : \Zend\View\Model\ViewModel
Inherited

Can be an array or a Traversable + ArrayAccess object.

inherited_from \Zend\View\Model\ModelInterface::setVariables()

Parameters

$variables

array\ArrayAccess\Traversable

$overwrite

boolean

Whether or not to overwrite the internal container with $variables

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

\Zend\View\Model\ViewModel

Is this considered a terminal or standalone model?

terminate() : boolean
Inherited
inherited_from \Zend\View\Model\ModelInterface::terminate()

Returns

boolean

 Properties

 

Is this append to child with the same capture?

$append : boolean

Default

false
 

JSON probably won't need to be captured into a a parent container by default.

$captureTo : string

Default

null
inherited_from \Zend\View\Model\ViewModel::captureTo
 

What variable a parent model should capture this model to

$captureTo : string

Default

'content'
 

Child models

$children : array

Default

array()
 

JSONP callback (if set, wraps the return in a function call)

$jsonpCallback : string

Default

null
 

Renderer options

$options : array

Default

array()
 

Template to use when rendering this model

$template : string

Default

''
 

JSON is usually terminal

$terminate : boolean

Default

true
inherited_from \Zend\View\Model\ViewModel::terminate
 

Is this a standalone, or terminal, model?

$terminate : boolean

Default

false
 

View variables

$variables : array | \Zend\View\Model\ArrayAccess&Traversable

Default

array()