Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Problem with navigation view helper (setPartial not working properly) #91

@wesperinteractive

Description

@wesperinteractive

Setting the module when calling setPartial has absolutely no effect.

Consider the following code:

<?php echo $this->navigation('navigation')
    ->menu()
    ->setMinDepth(0)
    ->setPartial(array('partial/menu.phtml', 'Application'));
 ?>

renderPartialModel function (https://github.com/zendframework/zend-view/blob/master/src/Helper/Navigation/Menu.php#L751) will return the $partialHelper with the following parameters:

return $partialHelper($partial[0], $model); // 'partial/menu.phtml' and $model

If we call the setPartial function with a string

<?php echo $this->navigation('navigation')
    ->menu()
    ->setMinDepth(0)
    ->setPartial('partial/menu.phtml');
 ?>

the same happens:

return $partialHelper($partial, $model); // 'partial/menu.phtml' and $model

Why is this a problem? If you have modules with two different menu templates saved under the same name (partial/menu.phtml), then the modules loading order will decide which template is used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions