Web\Url: add getQueryString() and without()

This commit is contained in:
Thomas Gelf 2014-06-05 03:44:12 +00:00
parent 11b4661b46
commit 1b3bb6cade
1 changed files with 10 additions and 0 deletions

View File

@ -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);