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.

category Zend
package Zend_View
subpackage Model

 Methods

Add a child model

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

Parameters

$captureTo

nullstring

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

$append

nullbool

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

Returns

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) : 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() : bool

Returns

bool

Is this append to child with the same capture?

isAppend() : bool

Returns

bool

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

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

Parameters

$append

bool

Returns

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

Set renderer option/hint

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

Parameters

$name

string

$value

mixed

Returns

Set renderer options/hints en masse

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

Parameters

$options

array\Traversable

Returns

Set the template to be used by this model

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

Parameters

$template

string

Returns

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

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

Parameters

$terminate

bool

Returns

Set view variable

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

Parameters

$name

string

$value

mixed

Returns

Set view variables en masse

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

Parameters

$variables

array\ArrayAccess

Returns

Is this considered a terminal or standalone model?

terminate() : bool

Returns

bool