- 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
|
||||
{
|
||||
$splitRoute = explode('/', $this->getRoute());
|
||||
|
||||
foreach($splitRoute as &$route) {
|
||||
if (strstr($route, '=')) {
|
||||
$route = preg_replace('/(\=.*)(?=\})/i', '', $route);
|
||||
}
|
||||
}
|
||||
|
||||
return implode('/', $splitRoute);
|
||||
return preg_replace('/(\=.*)(?=\})/i', '', $this->getRoute());
|
||||
}
|
||||
|
||||
public function matchRouteName(string $name) : bool
|
||||
|
|
Loading…
Reference in New Issue