This commit is contained in:
as2252258@163.com
2021-08-29 05:55:19 +08:00
parent c06f25fcf5
commit eee07bbc46
+14
View File
@@ -577,6 +577,20 @@ class Router extends HttpService implements RouterInterface
public function _loader()
{
$this->loadRouteDir(APP_PATH . 'routes');
$classes = Kiri::getAnnotation()->runtime(CONTROLLER_PATH);
$di = Kiri::getDi();
foreach ($classes as $class) {
$methods = $di->getMethodAttribute($class);
foreach ($methods as $method => $attribute) {
if (empty($attribute)) {
continue;
}
foreach ($attribute as $item) {
$item['class']::execute((object)$item['params'], $class, $method);
}
}
}
}
/**