- Added default values to routing
This commit is contained in:
parent
13d306aec9
commit
f462fcc597
|
@ -27,21 +27,13 @@ class Routing {
|
|||
) { }
|
||||
|
||||
public function registerRoute(ContainerInterface $container, string $urlBase) {
|
||||
#$this->registeredRoutes ??= [];
|
||||
|
||||
$this->router->group(rtrim($urlBase, "/"), function (RouteGroup $route) use ($container) {
|
||||
foreach($this->fetchRoutesAttributes() as $attribute) {
|
||||
$this->eventManager->execute(Event\RoutingCompileRoutes::class, $this, $attribute);
|
||||
|
||||
# Mapping every URLs from attributes in searched folders (Api, Controller, etc...)
|
||||
foreach((array) $attribute->method as $method) {
|
||||
#if (! empty($this->registeredRoutes[$attribute->getRoute().$method])) {
|
||||
# continue;
|
||||
#}
|
||||
|
||||
#$this->registeredRoutes[$attribute->getRoute().$method] = true;
|
||||
|
||||
$route->map(strtoupper($method), $attribute->getRoute(), function (ServerRequestInterface $request, array $arguments) use (
|
||||
$route->map(strtoupper($method), $attribute->getRegistrableRoute(), function (ServerRequestInterface $request, array $arguments) use (
|
||||
$container, $route, $attribute
|
||||
) : ResponseInterface {
|
||||
$class = $attribute->class;
|
||||
|
|
Loading…
Reference in New Issue