mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
[BUGFIX] Fixed missing / in beginning of url in getRoute when route does not exist.
This commit is contained in:
@@ -210,7 +210,7 @@ class RouterBase {
|
|||||||
|
|
||||||
protected function processUrl($route, $method = null, $parameters = null, $getParams = null) {
|
protected function processUrl($route, $method = null, $parameters = null, $getParams = null) {
|
||||||
|
|
||||||
$url = $route->getUrl();
|
$url = '/' . trim($route->getUrl(), '/');
|
||||||
|
|
||||||
if(($route instanceof RouterController || $route instanceof RouterResource) && $method !== null) {
|
if(($route instanceof RouterController || $route instanceof RouterResource) && $method !== null) {
|
||||||
$url .= $method;
|
$url .= $method;
|
||||||
@@ -306,7 +306,7 @@ class RouterBase {
|
|||||||
ArrayUtil::append($url, $parameters);
|
ArrayUtil::append($url, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
return join('/', $url);
|
return '/' . join('/', $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getInstance() {
|
public static function getInstance() {
|
||||||
|
|||||||
Reference in New Issue
Block a user