ViewModel

implements Countable , IteratorAggregate , Traversable , Zend\View\Model\ClearableModelInterface , Zend\View\Model\ModelInterface , Zend\View\Model\RetrievableChildrenInterface

Known subclasses

Omeka\View\Model\ApiJsonModel, Zend\View\Model\JsonModel
Methods Summary
public
# __construct( null|array|\Traversable $variables = NULL, array|\Traversable $options = NULL )
Constructor
public
# __set( string $name , mixed $value )
Property overloading: set variable value
public
# __get( string $name )
Property overloading: get variable value
public
# __isset( string $name )
Property overloading: do we have the requested variable value?
public
# __unset( string $name )
Property overloading: unset the requested variable
public
# setOption( string $name , mixed $value )
Set a single option

Implementation of

public
# getOption( string $name , mixed|null $default = NULL )
Get a single option
public
# setOptions( array|\Traversable $options )
Set renderer options/hints en masse

Implementation of

public
# getOptions( )
Get renderer options/hints

Implementation of

public
# clearOptions( )
Clear any existing renderer options/hints

Implementation of

public
# getVariable( string $name , mixed|null $default = NULL )
Get a single view variable

Implementation of

public
# setVariable( string $name , mixed $value )
Set view variable

Implementation of

public
# setVariables( array|\ArrayAccess|\Traversable $variables , bool $overwrite = false )
Set view variables en masse Can be an array or a Traversable + ArrayAccess object.

Implementation of

public
# getVariables( )
Get view variables

Implementation of

public
# clearVariables( )
Clear all variables Resets the internal variable container to an empty container.

Implementation of

public
# setTemplate( string $template )
Set the template to be used by this model

Implementation of

public
# getTemplate( )
Get the template to be used by this model

Implementation of

public
# addChild( Zend\View\Model\ModelInterface $child , null|string $captureTo = NULL, null|bool $append = NULL )
Add a child model

Implementation of

public
# getChildren( )
Return all children. Return specifies an array, but may be any iterable object.

Implementation of

public
# hasChildren( )
Does the model have any children?

Implementation of

public
# clearChildren( )
Clears out all child models

Implementation of

public
# getChildrenByCaptureTo( string $capture , bool $recursive = true )
Returns an array of Viewmodels with captureTo value $capture

Implementation of

public
# setCaptureTo( string $capture )
Set the name of the variable to capture this model to, if it is a child model

Implementation of

public
# captureTo( )
Get the name of the variable to which to capture this model

Implementation of

public
# setTerminal( bool $terminate )
Set flag indicating whether or not this is considered a terminal or standalone model

Implementation of

public
# terminate( )
Is this considered a terminal or standalone model?

Implementation of

public
# setAppend( bool $append )
Set flag indicating whether or not append to child with the same capture

Implementation of

public
# isAppend( )
Is this append to child with the same capture?

Implementation of

public
# count( )
Return count of children

Implementation of

public
# getIterator( )
Get iterator of children

Implementation of

Properties Summary
protected string $captureTo
What variable a parent model should capture this model to
# 'content'
protected array $children
Child models
# array ( )
protected array $options
Renderer options
# array ( )
protected string $template
Template to use when rendering this model
# ''
protected bool $terminate
Is this a standalone, or terminal, model?
# false
protected array|\ArrayAccess|\Traversable $variables
View variables
# array ( )
protected bool $append
Is this append to child with the same capture?
# false