How to get the name of the executable in PHP framework Slim v3. *?
Tried through \Slim\Router . I did not find suitable methods. Thank.
This should probably help you.
\Slim\Route . - Igor$routeInfo = $request->getAttribute('routeInfo'); $router = $this->container->get('router'); $route = $router->lookupRoute($routeInfo[1]); $name = $route->getName(); $routeInfo = $request->getAttribute('routeInfo'); $router = $this->container->get('router'); $route = $router->lookupRoute($routeInfo[1]); $name = $route->getName(); - PowarMiddleware I could not get the name of the route that matches the incoming url. The matter was solved by setting the determineRouteBeforeAppMiddleware key to true in the settings when the application was started. Then, before launching the application, Middleware searches for a route that matches the url and can be obtained in the way that you described. - IgorSource: https://ru.stackoverflow.com/questions/520703/
All Articles