- Route now supports default values
This commit is contained in:
parent
f199cc7085
commit
a4d99dfe08
|
@ -25,6 +25,19 @@ class Route implements \Notes\Attribute {
|
|||
"/" . ltrim($this->route, "/"), "/"), '/');
|
||||
}
|
||||
|
||||
public function getRegistrableRoute() : string
|
||||
{
|
||||
$splitRoute = explode('/', $this->getRoute());
|
||||
|
||||
foreach($splitRoute as &$route) {
|
||||
if (strstr($route, '=')) {
|
||||
$route = preg_replace('/(\=.*)(?=\})/i', '', $route);
|
||||
}
|
||||
}
|
||||
|
||||
return implode('/', $splitRoute);
|
||||
}
|
||||
|
||||
public function matchRouteName(string $name) : bool
|
||||
{
|
||||
return strtolower($this->name) === strtolower($name);
|
||||
|
|
Loading…
Reference in New Issue