mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
Added prependPrefix to Group class & updated documentation.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user