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