Zend\Navigation\Service\ConstructedNavigationFactory not inject dependences (router, action and etc) #3898

Closed
alexshelkov opened this Issue Feb 26, 2013 · 1 comment

2 participants

@alexshelkov

Test code:

$factory = new ConstructedNavigationFactory($pages);
$factory->createService($sm); //$sm is just application service manager, and it have all dependeces

This code throw an exception. But if I correct Zend\Navigation\Service\ConstructedNavigationFactory everything start working:

public function getPages(ServiceLocatorInterface $serviceLocator)
    {
        $application = $serviceLocator->get('Application'); // added
        $routeMatch = $application->getMvcEvent()->getRouteMatch(); // added
        $router = $application->getMvcEvent()->getRouter(); // added

        $this->pages = $this->injectComponents($this->pages, $routeMatch, $router); // added

        return $this->pages;
    }
@froschdesign
Zend Framework member

Duplicates #2898

@weierophinney weierophinney added a commit that closed this issue Mar 28, 2013
@weierophinney weierophinney Merge branch 'hotfix/4063'
Close #4063
Fixes #2898
Fixes #3898
5c69097
@ghost Unknown pushed a commit that referenced this issue Jul 14, 2013
@weierophinney weierophinney Merge branch 'hotfix/4063'
Close #4063
Fixes #2898
Fixes #3898
543d417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment