Web\Url: add getQueryString() and without()
This commit is contained in:
parent
11b4661b46
commit
1b3bb6cade
|
@ -298,6 +298,11 @@ class Url
|
||||||
return $this->path . '?' . http_build_query($params, '', '&') . $this->anchor;
|
return $this->path . '?' . http_build_query($params, '', '&') . $this->anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getQueryString()
|
||||||
|
{
|
||||||
|
return http_build_query($this->params, '', '&');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the absolute url with query parameters as a string
|
* Return the absolute url with query parameters as a string
|
||||||
*
|
*
|
||||||
|
@ -493,6 +498,11 @@ class Url
|
||||||
* @return Url
|
* @return Url
|
||||||
*/
|
*/
|
||||||
public function getUrlWithout($keyOrArrayOfKeys)
|
public function getUrlWithout($keyOrArrayOfKeys)
|
||||||
|
{
|
||||||
|
return $this->without($keyOrArrayOfKeys);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function without($keyOrArrayOfKeys)
|
||||||
{
|
{
|
||||||
$url = clone($this);
|
$url = clone($this);
|
||||||
$url->remove($keyOrArrayOfKeys);
|
$url->remove($keyOrArrayOfKeys);
|
||||||
|
|
Loading…
Reference in New Issue