Problem/Motivation
As a frontend developer I want to be able to resolve all types of routes from Drupal, not just entity routes.
Steps to reproduce
1. Setup a site with Druxt / Decoupled Router
2. Access /router/translate-path?path=/user/login
Proposed resolution
Make a fallback/wildcard/catchall path translator service that returns data pertaining to the route.
{
resolved: "https://8080-realityloop-starterkitd-tqhtzkxmv10.ws-us70.gitpod.io/user/login",
isHomePath: true,
label: "Log in",
context: {
_form: "\Drupal\user\Form\UserLoginForm",
_title: "Log in",
_route: "user.login",
_route_object: { },
_raw_variables: { },
_controller: "controller.form:getContentResult"
}
}
Remaining tasks
Create a WildcardPathTranslatorSubscriber service that provides the $match_info object as context for a frontend client to consume as required.
User interface changes
N/A
API changes
Add context
attribute to results.
Data model changes
Add context
attribute to results.