改名
This commit is contained in:
@@ -6,6 +6,7 @@ namespace HttpServer\Route;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\Controller;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use HttpServer\IInterface\RouterInterface;
|
||||
@@ -108,6 +109,10 @@ class Router extends HttpService implements RouterInterface
|
||||
$this->nodes[$method] = [];
|
||||
}
|
||||
|
||||
if ($handler instanceof Closure) {
|
||||
$handler = Closure::bind($handler, new Controller());
|
||||
}
|
||||
|
||||
if ($this->useTree == ROUTER_TREE) {
|
||||
return $this->tree($path, $handler, $method);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user