Interface ModelInterface

Summary

Fully Qualified Name: Zend\View\Model\ModelInterface
Extends: Countable, IteratorAggregate

Description

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.

Methods

Name Description Defined By
addChild() Add a child model ModelInterface
captureTo() Get the name of the variable to which to capture this model ModelInterface
getChildren() Return all children. ModelInterface
getOptions() Get renderer options/hints ModelInterface
getTemplate() Get the template to be used by this model ModelInterface
getVariable() Get a single view variable ModelInterface
getVariables() Get view variables ModelInterface
hasChildren() Does the model have any children? ModelInterface
isAppend() Is this append to child with the same capture? ModelInterface
setAppend() Set flag indicating whether or not append to child with the same capture ModelInterface
setCaptureTo() Set the name of the variable to capture this model to, if it is a child model ModelInterface
setOption() Set renderer option/hint ModelInterface
setOptions() Set renderer options/hints en masse ModelInterface
setTemplate() Set the template to be used by this model ModelInterface
setTerminal() Set flag indicating whether or not this is considered a terminal or standalone model ModelInterface
setVariable() Set view variable ModelInterface
setVariables() Set view variables en masse ModelInterface
terminate() Is this considered a terminal or standalone model? ModelInterface

Method Details

addChild()

Add a child model

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

Returns: \ModelInterface

captureTo()

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

Returns: string

getChildren()

Return all children.

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

Returns: array

getOptions()

Get renderer options/hints

Returns: array|\Traversable

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

hasChildren()

Does the model have any children?

Returns: bool

isAppend()

Is this append to child with the same capture?

Returns: bool

setAppend()

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

Parameter Name Type Description
$append bool

Returns: \ModelInterface

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

setOption()

Set renderer option/hint

Parameter Name Type Description
$name string
$value mixed

Returns: \ModelInterface

setOptions()

Set renderer options/hints en masse

Parameter Name Type Description
$options array|\Traversable

Returns: \ModelInterface

setTemplate()

Set the template to be used by this model

Parameter Name Type Description
$template string

Returns: \ModelInterface

setTerminal()

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

Parameter Name Type Description
$terminate bool

Returns: \ModelInterface

setVariable()

Set view variable

Parameter Name Type Description
$name string
$value mixed

Returns: \ModelInterface

setVariables()

Set view variables en masse

Parameter Name Type Description
$variables array|\ArrayAccess

Returns: \ModelInterface

terminate()

Is this considered a terminal or standalone model?

Returns: bool

Top