In routing.yml
Login:
url: /login
param: { module: access, action: login }
then I have:
$module = 'access';
$action = 'login';
I want to get the routing name ?? // login
Something like getRoutingName($module, $action) return "login".
What you are looking for is almost
getRouteThatMatchesParameters. It find a route for some parameters (module, action & query string).Here is a quick snippet to retrieve a route name from a module & action name:
Be careful. I put
breakbecause it can retrieve multiple route (for example it will often return the default route (which is generally/:module/:action/*)).