summaryrefslogtreecommitdiff
path: root/src/Router/Router.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Router/Router.php')
-rw-r--r--src/Router/Router.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Router/Router.php b/src/Router/Router.php
index 61abed1..534b7f7 100644
--- a/src/Router/Router.php
+++ b/src/Router/Router.php
@@ -59,7 +59,12 @@ class Router
$class = $match["_controller"][0];
$method = $match["_controller"][1];
- return (new $class)->$method();
+ $request->attributes->add(array_diff_key(
+ $match,
+ array_flip(["_controller", "_route"])
+ ));
+
+ return (new $class)->$method($request);
} catch (Exception $exception) {
return ErrorResponse::fromException($exception);
} catch (ResourceNotFoundException $exception) {