Zend-Expressive and Child Routes

expressive

#1

Hello,

I wanted to try expressive in a new project and got to the routing configuration.

Is there any way to setup child routes ? FastRoute and Zend-Router support them but there is no “expressive way” to configure them.

I’d have to completly forgo the Application and RouteCollector and add them to the respective Routers (e. g. using a delegator) themselves.

The only drawback I currently see is, that I wont be able to easily switch to another Router anymore, but thats ok. Is there any other drawback? Neither the Expressive-RouteCollector nor the Expressive-Application would know about the routes (they both have a $routes property) and I’d have to duplicate all code that lives in the respective injectRoute() methods.

Is there anything planned to support child routes in the future? I’ve seen the discussion in https://github.com/zendframework/zend-expressive/issues/336 but a few things changed since then (e. g. all 3 routers now support child routes).

Thanks for your help.


#2

There is nothing planned but it’s certainly something interesting that could make setting up routes easier.