Open weierophinney opened 4 years ago
There are differences between Aura router and FastRoute. I guess the options values are not passed as request attributes like in Aura router. I need to dig into the code but I think this is something specifically for Aura router. If I remember correctly, this is the exact reason that Prooph has chosen Aura router.
Something like this does work for me with FastRoute and should work with other routers as well:
$routeResult = $request->getAttribute(\Zend\Expressive\Router\RouteResult::class, false);
$matchedRoute = $routeResult->getMatchedRoute();
$matchedRoute->getOptions()['values']['prooph_command_name'];
Originally posted by @geerteltink at https://github.com/zendframework/zend-expressive-fastroute/issues/58#issuecomment-376490276
Ah, then I would expect prooph to also support this in their Handler
Originally posted by @basz at https://github.com/zendframework/zend-expressive-fastroute/issues/58#issuecomment-376493604
Provide a narrative description of what you are trying to accomplish.
Code to reproduce the issue
Given this route configuration
in \Prooph\HttpMiddleware\CommandMiddleware::class
Expected results
Route option values should set as request attribute
Actual results
Request attribute is not passed
This works with the aurarouter. Switching the router makes this bug appear.
https://github.com/prooph/proophessor-do/issues/162
Originally posted by @basz at https://github.com/zendframework/zend-expressive-fastroute/issues/58