Helper for rendering a template fragment in its own variable scope; iterates over data provided and renders for each iteration.

package Default
inherited_from \Zend\View\Helper\Partial

 Methods

Renders a template fragment within a variable scope distinct from the calling View object.

__invoke(string $name = null, array $values = null) : string

If no arguments are provided, returns object instance.

inherited_from \Zend\View\Helper\Partial::__invoke()

Parameters

$name

string

Name of view script

$values

array

Variables to populate in the view

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

string

Renders a template fragment within a variable scope distinct from the calling View object. It proxies to view's render function

__invoke(string|\Zend\View\Model\ModelInterface $name = null, array|object $values = null) : string | \Zend\View\Helper\Partial
Inherited

Parameters

$name

string\Zend\View\Model\ModelInterface

Name of view script, or a view model

$values

arrayobject

Variables to populate in the view

Exceptions

\Zend\View\Exception\RuntimeException

Returns

string\Zend\View\Helper\Partial

Retrieve object key

getObjectKey() : null | string
Inherited

The objectKey is the variable to which an object in the iterator will be assigned.

Returns

nullstring

Get the partial counter

getPartialCounter() : integer

Returns

integer

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited
inherited_from \Zend\View\Helper\HelperInterface::getView()

Returns

null\Zend\View\Renderer\RendererInterface

Set object key in this loop and any child loop

setObjectKey(string|null $key) : \Zend\View\Helper\PartialLoop
inherited_from \Zend\View\Helper\Partial::setObjectKey()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$key

stringnull

Returns

\Zend\View\Helper\PartialLoop

Set object key

setObjectKey(string|null $key) : \Zend\View\Helper\PartialLoop
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$key

stringnull

Returns

\Zend\View\Helper\PartialLoop

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited
inherited_from \Zend\View\Helper\HelperInterface::setView()

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\Helper\AbstractHelper

extractViewVariables()

extractViewVariables(mixed $values) : array

Parameters

$values

mixed

Returns

arrayVariables to populate in the view

Increment nestedLevel and default objectKey to parent's value

nestObjectKey() : \Zend\View\Helper\PartialLoop
fluent This method is part of a fluent interface and will return the same instance

Returns

\Zend\View\Helper\PartialLoop

Decrement nestedLevel and restore objectKey to parent's value

unNestObjectKey() : \Zend\View\Helper\PartialLoop
fluent This method is part of a fluent interface and will return the same instance

Returns

\Zend\View\Helper\PartialLoop

 Properties

 

Variable to which object will be assigned

$objectKey : string

Default

 

Marker to where the pointer is at in the loop

$partialCounter : integer

Default

0
 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null
 

The current nesting level

$nestingLevel : integer

Default

0
 

Stack with object keys for each nested level

$objectKeyStack : array

Default

array(0 => null)