I am trying to make a modular app, where I would like to put a router inside every module.
How do I make a prefix for every module, so that if you enter url "/admin" the module admin router will be loaded, and if you enter url "/frontpage" the module frontpage router will be loaded?
I was searching around, and the only thing I can find, is to put everything into ONE router file, but i would like to avoid that
Also the code: $router->addModuleResource('admin','Index'); does not work. I have to make a direct namespace to where the module exists.
Does anyone know how to put router inside modules? Thank you!