summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Router.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Router.php b/src/Router.php
index 34d2695..4463150 100644
--- a/src/Router.php
+++ b/src/Router.php
@@ -174,4 +174,12 @@ class Router
{
return $this->namedRoutes[$name] ?? null;
}
+
+ /** @param array<string, mixed> $params */
+ public function route(string $name, array $params = []): ?string
+ {
+ $route = $this->getNamedRoute($name);
+ $params = $this->strategy->parseParameters($params);
+ return $route?->getPath($params);
+ }
}