zendframework/zf2 — pull request #3519 by bakura10 (2013-01-22 18:29:46+00:00)
Title: Allow to pull route manager from sl

This PR addresses the following issue : https://github.com/zendframework/zf2/issues/3516#issuecomment-12552600

It was not easy because the Router uses static factories too much and doing it the clean way (by using invokables set in the plugin manager and properly pull everything from the service locator) would without any doubt bring some BC...

So I just did it the easy way by not calling the factory of default Http and Console routers and copy/pasting the code from the static function factory to the factory class itself. Not really that beautiful but well... I think this is a BC we should do as it makes the code quite hard to extend.

Anyway, this PR adds a new ModuleManager feature that allow to add routes either from a getRouteConfig in your Module.php, or using the routes key in service manager config:

```php
return array(
'routes' => array(
'Rest' => 'ZfrRest\Mvc\Router\Route\Rest'
)
);
```

And then use it in the router:

```php
return array(
'router' => array(
'routes' => array(
'dummy' => array(
'type' => 'Rest'
)
)
)
);
```