Deploy on 2026-06-05 16:08:53

This commit is contained in:
Hamza-Ayed
2026-06-05 16:08:53 +03:00
parent c0da60069f
commit 54065628bf
12 changed files with 316 additions and 167 deletions

View File

@@ -40,14 +40,15 @@ class App
$this->request->setRouteParams($params);
// Run Middleware Chain
$this->executeMiddlewareChain($middlewares, function() use ($callback) {
$this->executeMiddlewareChain($middlewares, function() use ($callback, $params) {
// Execute Route action
if (is_callable($callback)) {
$response = $callback($this->request, $this->response);
$response = call_user_func_array($callback, array_merge([$this->request, $this->response], array_values($params)));
} else {
[$controllerClass, $method] = $callback;
$controller = $this->container->get($controllerClass);
$response = $controller->$method($this->request, $this->response);
$args = array_merge([$this->request, $this->response], array_values($params));
$response = call_user_func_array([$controller, $method], $args);
}
// Auto-output string responses as HTML