Added prependPrefix to Group class & updated documentation.

This commit is contained in:
Simon Sessingø
2021-03-31 03:23:04 +02:00
parent 7adb4e8597
commit eccda10169
4 changed files with 28 additions and 36 deletions

View File

@@ -53,6 +53,14 @@ interface IGroupRoute extends IRoute
*/
public function setDomains(array $domains): self;
/**
* Prepend url
*
* @param string $url
* @return static
*/
public function prependUrl(string $url): self;
/**
* Set prefix that child-routes will inherit.
*

View File

@@ -153,6 +153,17 @@ class RouteGroup extends Route implements IGroupRoute
return $this;
}
/**
* Prepend prefix
*
* @param string $url
* @return static
*/
public function prependUrl(string $url): IGroupRoute
{
return $this->setPrefix(rtrim($url, '/') . $this->prefix);
}
/**
* Set prefix that child-routes will inherit.
*