I am using this tutorial https://docs.zendframework.com/tutorials/getting-started/overview/ for creating album module. It works for me.
Inside project there is /module/Album/config/module.config.php file which contains routes. Routers are located inside an array tree. As my previous experience shows I can have in the future dozens of routes per a project (even per a module).
On this documentation page https://docs.zendframework.com/zend-router/routing/ I found another way to add routers to the module.
// One at a time:
$route = Literal::factory([
'route' => '/foo',
'defaults' => [
'controller' => 'foo-index',
'action' => 'index',
],
]);
$router->addRoute('foo', $route);
Such a way is preferred for me than storing routes in a very deep config array tree.
So, my question is: where I can put php routers code outside a config tree as I have mentioned earlier? Where in the module should be such a routers-file located at?