mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 03:12:09 +00:00
- Fixed domains not being prepending properly to urls.
- Won't prepend subdomain to urls if subdomain is equal to current host. - Url: implemented parse function. - Router: getUrl now parses url to properly parse the subdomain.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Pecee\SimpleRouter\Route;
|
||||
|
||||
use Pecee\Http\Request;
|
||||
use Pecee\SimpleRouter\SimpleRouter;
|
||||
|
||||
class RouteResource extends LoadableRoute implements IControllerRoute
|
||||
{
|
||||
@@ -80,7 +81,14 @@ class RouteResource extends LoadableRoute implements IControllerRoute
|
||||
return rtrim($this->url . $parametersUrl . $this->urls[$url], '/') . '/';
|
||||
}
|
||||
|
||||
return $this->url . $parametersUrl;
|
||||
$url = $this->url . $parametersUrl;
|
||||
|
||||
$group = $this->getGroup();
|
||||
if ($group !== null && count($group->getDomains()) !== 0 && SimpleRouter::request()->getHost() !== $group->getDomains()[0]) {
|
||||
$url = '//' . $group->getDomains()[0] . $url;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
protected function call($method): bool
|
||||
|
||||
Reference in New Issue
Block a user