Added a new matchRouteName method
This commit is contained in:
parent
6fcfd20aed
commit
4d6a2f2681
|
@ -42,8 +42,13 @@ class Route implements \Notes\Annotation {
|
||||||
public function getRoute() : string
|
public function getRoute() : string
|
||||||
{
|
{
|
||||||
return rtrim("/" . trim(isset($this->base) ?
|
return rtrim("/" . trim(isset($this->base) ?
|
||||||
"/" . trim($this->base, "/") . "/" . ltrim($this->route, "/")
|
"/" . trim($this->base, "/") . "/" . ltrim($this->route, "/")
|
||||||
:
|
:
|
||||||
"/" . ltrim($this->route, "/"), "/"), '/');
|
"/" . ltrim($this->route, "/"), "/"), '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function matchRouteName(string $name) : bool
|
||||||
|
{
|
||||||
|
return strtolower($this->name) === strtolower($name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue