If I have a typical entry in my routes file for importing routes from a module
* /admin module:crud
is there a way for me to determine that the base path for the crud
module is /admin
, other than just parsing the main routes file myself? It doesn't appear that the Router
class keeps this information.
The ultimate goal is to create a menu for each module. If I have a user management module imported at /useradmin
, I want to generate a menu containing /useradmin/users
and /useradmin/groups
but not deeper descendants such as /useradmin/users/new
. If /useradmin
is routed to something, I'll use that as the link for the menu's label, otherwise I'll just show a plain text label.
While I might be able to fake it without knowing, it seems like knowing the actual base url for the module would be the best way to ensure I can handle various special cases such as modules imported at /modules/useradmin
or modules that grandchild paths but no child paths (/useradmin/users/new
but no /useradmin/users
).