diff --git a/function.php b/function.php index 99d2a2af..dcfef820 100644 --- a/function.php +++ b/function.php @@ -255,15 +255,15 @@ if (!function_exists('injectRuntime')) { $methods = $target->getMethodsAttribute(); foreach ($methods as $method => $attribute) { - if (str_contains($class, 'SiteController')) { echo $class, ' ', $method, ' ', var_export($attribute, 'true'), PHP_EOL; } - + /** @var ReflectionAttribute $item */ foreach ($attribute as $item) { + if (!class_exists($item->getName())) { + continue; + } $item = $item->newInstance(); - - if ($item instanceof Route) { $router[] = [$item, $class, $method]; } else {