Insteadof $urlGenerator->generate('long_route_name_possibly_autogenerated', $params) maybe its possible to provide something like:
$urlGenerator->generate(MyAction::class, $params)
$urlGenerator[MyAction::class]($params)
$myAction->route($params)
Possible implementation strategies:
- Decorate route loader to register 2 routes (one named with autogenerated name, one with FQCN as route name) for
__invokeable controllers
- Decorate
UrlGenerator to generate route name from args that match a FQCN (if($classLoader->exists($routeName)) $routeName = $this->getDefaultRouteName($routeName);)
- Keep a map in
UrlGenerator to map route names (if($this->routeMap[$routeName]) $routeName = $this->routeMap[$routeName];)
WDYT?
Insteadof
$urlGenerator->generate('long_route_name_possibly_autogenerated', $params)maybe its possible to provide something like:$urlGenerator->generate(MyAction::class, $params)$urlGenerator[MyAction::class]($params)$myAction->route($params)Possible implementation strategies:
__invokeable controllersUrlGeneratorto generate route name from args that match a FQCN (if($classLoader->exists($routeName)) $routeName = $this->getDefaultRouteName($routeName);)UrlGeneratorto map route names (if($this->routeMap[$routeName]) $routeName = $this->routeMap[$routeName];)WDYT?