diff --git a/src/Core/Router/Route.php b/src/Core/Router/Route.php index 577eb6e4..7a812c10 100644 --- a/src/Core/Router/Route.php +++ b/src/Core/Router/Route.php @@ -269,7 +269,14 @@ public function compile(): Route $new->setOptions($options); if ($options['extra']['default_controller'] ?? null) { - $new->controller($options['extra']['default_controller']); + foreach ($new->options['handlers'] as $k => &$handler) { + if (is_string($handler)) { + $handler = [ + $options['extra']['default_controller'], + $handler + ]; + } + } } if ($options['extra']['default_view'] ?? null) {