1209. Class

1209.1. Zend\View\Model\ViewModel

1209.1.1. Methods

1209.1.1.1. __construct

__construct()

Constructor

Parameters:
  • null|array|Traversable
  • array|Traversable

1209.1.1.2. __set

__set()

Property overloading: set variable value

Parameters:
  • string
  • mixed
Return type:

void

1209.1.1.3. __get

__get()

Property overloading: get variable value

Parameters:string
Return type:mixed

1209.1.1.4. __isset

__isset()

Property overloading: do we have the requested variable value?

Parameters:string
Return type:bool

1209.1.1.5. __unset

__unset()

Property overloading: unset the requested variable

Parameters:string
Return type:void

1209.1.1.6. setOption

setOption()

Set a single option

Parameters:
  • string
  • mixed
Return type:

ViewModel

1209.1.1.7. getOption

getOption()

Get a single option

Parameters:
  • string – The option to get.
  • mixed|null – (optional) A default value if the option is not yet set.
Return type:

mixed

1209.1.1.8. setOptions

setOptions()

Set renderer options/hints en masse

Parameters:array|Traversable
Throws ZendViewExceptionInvalidArgumentException:
 
Return type:ViewModel

1209.1.1.9. getOptions

getOptions()

Get renderer options/hints

Return type:array

1209.1.1.10. clearOptions

clearOptions()

Clear any existing renderer options/hints

Return type:ViewModel

1209.1.1.11. getVariable

getVariable()

Get a single view variable

Parameters:
  • string
  • mixed|null – (optional) default value if the variable is not present.
Return type:

mixed

1209.1.1.12. setVariable

setVariable()

Set view variable

Parameters:
  • string
  • mixed
Return type:

ViewModel

1209.1.1.13. setVariables

setVariables()

Set view variables en masse

Can be an array or a Traversable + ArrayAccess object.

Parameters:
  • array|ArrayAccess|Traversable
  • bool – Whether or not to overwrite the internal container with $variables
Throws ExceptionInvalidArgumentException:
 
Return type:

ViewModel

1209.1.1.14. getVariables

getVariables()

Get view variables

Return type:array|ArrayAccess|Traversable

1209.1.1.15. clearVariables

clearVariables()

Clear all variables

Resets the internal variable container to an empty container.

Return type:ViewModel

1209.1.1.16. setTemplate

setTemplate()

Set the template to be used by this model

Parameters:string
Return type:ViewModel

1209.1.1.17. getTemplate

getTemplate()

Get the template to be used by this model

Return type:string

1209.1.1.18. addChild

addChild()

Add a child model

Parameters:
  • ModelInterface
  • null|string – Optional; if specified, the “capture to” value to set on the child
  • null|bool – Optional; if specified, append to child with the same capture
Return type:

ViewModel

1209.1.1.19. getChildren

getChildren()

Return all children.

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

Return type:array

1209.1.1.20. hasChildren

hasChildren()

Does the model have any children?

Return type:bool

1209.1.1.21. clearChildren

clearChildren()

Clears out all child models

Return type:ViewModel

1209.1.1.22. setCaptureTo

setCaptureTo()

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

Parameters:string
Return type:ViewModel

1209.1.1.23. captureTo

captureTo()

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

Return type:string

1209.1.1.24. setTerminal

setTerminal()

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

Parameters:bool
Return type:ViewModel

1209.1.1.25. terminate

terminate()

Is this considered a terminal or standalone model?

Return type:bool

1209.1.1.26. setAppend

setAppend()

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

Parameters:bool
Return type:ViewModel

1209.1.1.27. isAppend

isAppend()

Is this append to child with the same capture?

Return type:bool

1209.1.1.28. count

count()

Return count of children

Return type:int

1209.1.1.29. getIterator

getIterator()

Get iterator of children

Return type:ArrayIterator