Interface describing a view model.

Extends "Countable"; count() should return the number of children attached to the model.

Extends "IteratorAggregate"; should allow iterating over children.

package Default

 Methods

Add a child model

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

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\ModelInterface

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

captureTo() : string

Returns

string

Return all children.

getChildren() : array

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

Returns

array

Get renderer options/hints

getOptions() : array | \Traversable

Returns

array\Traversable

Get the template to be used by this model

getTemplate() : string

Returns

string

Get a single view variable

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

Parameters

$name

string

$default

mixednull

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

Returns

mixed

Get view variables

getVariables() : array | \ArrayAccess

Returns

array\ArrayAccess

Does the model have any children?

hasChildren() : boolean

Returns

boolean

Is this append to child with the same capture?

isAppend() : boolean

Returns

boolean

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

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

Parameters

$append

boolean

Returns

\Zend\View\Model\ModelInterface

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

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

Parameters

$capture

string

Returns

\Zend\View\Model\ModelInterface

Set renderer option/hint

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

Parameters

$name

string

$value

mixed

Returns

\Zend\View\Model\ModelInterface

Set renderer options/hints en masse

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

Parameters

$options

array\Traversable

Returns

\Zend\View\Model\ModelInterface

Set the template to be used by this model

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

Parameters

$template

string

Returns

\Zend\View\Model\ModelInterface

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

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

Parameters

$terminate

boolean

Returns

\Zend\View\Model\ModelInterface

Set view variable

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

Parameters

$name

string

$value

mixed

Returns

\Zend\View\Model\ModelInterface

Set view variables en masse

setVariables(array|\ArrayAccess $variables) : \Zend\View\Model\ModelInterface

Parameters

$variables

array\ArrayAccess

Returns

\Zend\View\Model\ModelInterface

Is this considered a terminal or standalone model?

terminate() : boolean

Returns

boolean