I would like to recover a road with URL::FromRoute
Except that I have some concerns when I use to toString
$path = Url::fromRoute('my_route_name',['mypParamsId' => 'MYPARAMSID'])->toString();
In this way I find a road but it's not the right one
I wish I could recover that
$path = Url::fromRoute('my_route_name',['mypParamsId' => '{MYPARAMSID}'])->toString();
But when I use the toString it does not work and Drupal cannot access my route and if I remove the String it returns my object to me without error