You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using league/container in my project and have this code to set up my container:
$container->add('Router', function () use ($container) {
$router = newRouteCollection($container);
$router->setStrategy(newRestfulStrategy);
// ... list of routesreturn$router;
});
The problem is that when my controllers are called with action($request) the request is a new instance and not the request that was used to dispatch. I would suggest adding a method to RestfulStrategy that would allow the request name to be set:
Yes the aliasing will be getting added to the strategy for v1 shortly, as for v2, it will be using PSR-7 for the request and response objects.
The reason this was emitted originally was so that the user could have the choice of how to build the request object. If it is done for you then it's limiting any manipulation of the request.
I am using
league/container
in my project and have this code to set up my container:And then this code to dispatch the request:
The problem is that when my controllers are called with
action($request)
the request is a new instance and not the request that was used to dispatch. I would suggest adding a method toRestfulStrategy
that would allow the request name to be set:This would allow me to do the following, without having to use a FQCN in my container:
The text was updated successfully, but these errors were encountered: