ZF2-117: Zend\Navigation\Container::addPages() should accept a Zend\NavigationContainer

Issue Type: Bug Created: 2011-12-07T21:27:00.000+0000 Last Updated: 2012-01-09T17:51:00.000+0000 Status: Resolved Fix version(s): Reporter: Rob Allen (rob) Assignee: Frank Brückner (frosch) Tags: - Zend\Navigation

Related issues: Attachments:


This is the ZF2 version of ZF-9815

The addPages() method of Zend_Navigation_Container only takes an array or a Zend_Config instance. It should also accept a Zend_Navigation_Container.

It's a fairly minor fix. Insert the following into the addPages method:

<pre class="highlight">
if ($pages instanceof Zend_Navigation_Container) {
    $pages = iterator_to_array($pages);

The docblocks and exception message will also need updating. Note: this uses iterator_to_array instead of getPages so that the order of pages will be consistent with calling toArray().


Posted by Rob Allen (rob) on 2011-12-07T21:28:36.000+0000

Pull Request fixes this one, but can't be applied as Zend\Navigation needs refactoring to remove FrontController dependencies.

Posted by Frank Brückner (frosch) on 2011-12-08T11:42:34.000+0000

We have no more dependencies to the FronController:…

Posted by Frank Brückner (frosch) on 2012-01-09T17:51:00.000+0000

Fixed with GH-708

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.