zendframework/zf2 — pull request #6717 by sandrokeil (2014-09-30 15:37:23+00:00)
Title: added NameNavigationFactory to create navigation from config key name

I use several navigation configs and i want to create navigation instances via config name. For example:

```php
// navigation config e.g. in module.config.php
return array(
// other stuff before
'navigation' => array(
'special' => array(
array(
'label' => 'Page 1',
'uri' => 'page1.html'
),
array(
'label' => 'MVC Page',
'route' => 'foo',
'pages' => array(
array(
'label' => 'Sub MVC Page',
'route' => 'foo'
)
)
),
array(
'label' => 'Page 3',
'uri' => 'page3.html'
)
)
)
);
```

So it's very easy to create new navigation instances which uses another config.
```php
// service manager config e.g. in module.config.php
return array(
// other stuff before
'service_manager' => array(
'factories' => array(
'mymodule.navigation.special' => new \Zend\Navigation\Service\NameNavigationFactory('special'),
),
),
);
```
Maybe we could remove `\Zend\Navigation\Service\DefaultNavigationFactory` and set parameter `$name = 'default'` in `\Zend\Navigation\Service\NameNavigationFactory::__construct`, but this is a BC break.