From 20fc0677657fdaacf5acdd473cf0f69312206d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Sat, 24 Oct 2015 23:18:16 +0200 Subject: [PATCH] [FEATURE] If no parameters are specified in the route, getRoute will now add the parameters provided to the method instead. --- src/Pecee/SimpleRouter/RouterBase.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Pecee/SimpleRouter/RouterBase.php b/src/Pecee/SimpleRouter/RouterBase.php index 13e6c66..c5275cf 100644 --- a/src/Pecee/SimpleRouter/RouterBase.php +++ b/src/Pecee/SimpleRouter/RouterBase.php @@ -230,6 +230,11 @@ class RouterBase { $url = str_ireplace('{' . $param. '}', $value, $url); $i++; } + } else { + // If no parameters are specified in the route, assume that the provided parameters should be used. + if(count($parameters)) { + $url .= join('/', $parameters); + } } }