Deploy on 2026-06-05 16:08:53
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user