If I know the internal path of my page (e.g. 'node/1') how do I get the router name?
I need it it to generate an internal url:
$url = Url::fromRoute($router_name);
I found Url::getRouteName, but I'm not sure if this is what I need?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can also do like this
$route_name = Url::fromUserInput($internal_path)->getRouteName();