parent
201c24107d
commit
f91892cb80
|
@ -385,6 +385,23 @@ class Url
|
|||
return $this->params->shift($param, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the given URL matches this URL object
|
||||
*
|
||||
* This does an exact match, parameters MUST be in the same order
|
||||
*
|
||||
* @param Url|string $url the URL to compare against
|
||||
*
|
||||
* @return bool whether the URL matches
|
||||
*/
|
||||
public function matches($url)
|
||||
{
|
||||
if (! $url instanceof Url) {
|
||||
$url = Url::fromPath($url);
|
||||
}
|
||||
return (string) $url === (string) $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a copy of this url without the parameter given
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue