This commit is contained in:
2021-09-18 11:09:15 +08:00
parent 37a341dd1b
commit a5f506b463
+3 -1
View File
@@ -47,6 +47,7 @@ class Router
* @param string|array $method
* @param string $route
* @param string|Closure $closure
* @throws \ReflectionException
*/
public function addRoute(string|array $method, string $route, string|Closure $closure)
{
@@ -61,7 +62,8 @@ class Router
$this->addMiddlewares($controller, $closure[0]);
}
foreach ($method as $value) {
HandlerManager::add($route, $value, $closure);
HandlerManager::add($route, $value,
new Handler($route, $closure));
}
}