- Reworked url default value removal; preg_replace will remove them without having to slit the string
This commit is contained in:
parent
a4d99dfe08
commit
63c7dc23f9
|
@ -27,15 +27,7 @@ class Route implements \Notes\Attribute {
|
||||||
|
|
||||||
public function getRegistrableRoute() : string
|
public function getRegistrableRoute() : string
|
||||||
{
|
{
|
||||||
$splitRoute = explode('/', $this->getRoute());
|
return preg_replace('/(\=.*)(?=\})/i', '', $this->getRoute());
|
||||||
|
|
||||||
foreach($splitRoute as &$route) {
|
|
||||||
if (strstr($route, '=')) {
|
|
||||||
$route = preg_replace('/(\=.*)(?=\})/i', '', $route);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode('/', $splitRoute);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function matchRouteName(string $name) : bool
|
public function matchRouteName(string $name) : bool
|
||||||
|
|
Loading…
Reference in New Issue