Skip to content

Commit 20fc067

Browse files
committed
[FEATURE] If no parameters are specified in the route, getRoute will now
add the parameters provided to the method instead.
1 parent d6bdcbe commit 20fc067

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Pecee/SimpleRouter/RouterBase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ protected function processUrl($route, $method = null, $parameters = null, $getPa
230230
$url = str_ireplace('{' . $param. '}', $value, $url);
231231
$i++;
232232
}
233+
} else {
234+
// If no parameters are specified in the route, assume that the provided parameters should be used.
235+
if(count($parameters)) {
236+
$url .= join('/', $parameters);
237+
}
233238
}
234239
}
235240

0 commit comments

Comments
 (0)