src/View/Helper/Menu.php
public function htmlifyWithPartial(AbstractPage $page, $escapeLabel = true, $addClassToListItem = false, $partial = null)
    {
        if (null === $partial) {
            $partial = $this->getPartial();
        }

        if (empty($partial)) {
            throw new Exception\RuntimeException(
                'Unable to render menu: No partial view script provided'
            );
        }

        $model = [
            'page' => $page,
            'escapeLabel' => $escapeLabel,
            'addClassToListItem' => $addClassToListItem,
            'menu' => (clone $this),

        ];

        /** @var \Zend\View\Helper\Partial $partialHelper */
        $partialHelper = $this->view->plugin('partial');
        if (is_array($partial)) {
            if (count($partial) != 2) {
                throw new Exception\InvalidArgumentException(
                    'Unable to render menu: A view partial supplied as '
                    . 'an array must contain two values: partial view '
                    . 'script and module where script can be found'
                );
            }

            return $partialHelper($partial[0], $model);
        }

        return $partialHelper($partial, $model);
    }
public function htmlifyWithPartial(AbstractPage $page, $escapeLabel = true, $addClassToListItem = false, $partial = null)
    {
        if (null === $partial) {
            $partial = $this->getPartial();
        }

        if (empty($partial)) {
            throw new Exception\RuntimeException(
                'Unable to render menu: No partial view script provided'
            );
        }

        $model = [
            'page' => $page,
            'escapeLabel' => $escapeLabel,
            'addClassToListItem' => $addClassToListItem,
            'menu' => (clone $this),

        ];

        /** @var \Zend\View\Helper\Partial $partialHelper */
        $partialHelper = $this->view->plugin('partial');
        if (is_array($partial)) {
            if (count($partial) != 2) {
                throw new Exception\InvalidArgumentException(
                    'Unable to render menu: A view partial supplied as '
                    . 'an array must contain two values: partial view '
                    . 'script and module where script can be found'
                );
            }

            return $partialHelper($partial[0], $model);
        }

        return $partialHelper($partial, $model);
    }
Renders the given $page by invoking the partial view helper

The container will simply be passed on as a model to the view script
as-is, and will be available in the partial script as 'container', e.g.
<code>echo 'Number of pages: ', count($this->container);</code>.

@param  AbstractPage $page page to generate HTML for
@param  bool $escapeLabel Whether or not to escape the label
@param  bool $addClassToListItem Whether or not to add the page class to the list item
@param  string|array $partial [optional] partial view script to use.
Default is to use the partial
registered in the helper. If an array
is given, it is expected to contain two
values; the partial view script to use,
and the module where the script can be
found.
@return string
@throws Exception\RuntimeException if no partial provided
@throws Exception\InvalidArgumentException if partial is invalid array