From c95cc8d799ca0f4932602ad54bc1e540b0163d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 13 Aug 2021 15:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Route/Route.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Annotation/Route/Route.php b/Annotation/Route/Route.php index 6a1f4c1b..d5a8a07b 100644 --- a/Annotation/Route/Route.php +++ b/Annotation/Route/Route.php @@ -37,7 +37,11 @@ use Kiri\Kiri; { // TODO: Implement setHandler() method. $router = Kiri::app()->getRouter(); - $router->addRoute($this->uri, [di($class), $method], $this->method); + + if (is_string($class)) { + $class = di($class); + } + $router->addRoute($this->uri, [$class, $method], $this->method); return $router; }