Код: Выделить всё
return call_user_func(sprintf("%s::%s", $route['controller'], $route['action']), $request, ...$params);
Когда контроллером маршрута является App\Controllers\HealthController и действие проверяется (кстати, статический метод), я получаю ошибку
Код: Выделить всё
2024-09-16T12:06:36+0000 INFO server TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "App\Controllers\HealthController" not found in /app/Core/Router.php:80
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/78990113/dynamically-invoke-a-class-method-without-initializing-the-class[/url]
Мобильная версия