Pagekit\Application\UrlProvider::parseQuery PHP Method

parseQuery() protected method

Parses query parameters into a URL.
protected parseQuery ( string $url, array $parameters = [] ) : string
$url string
$parameters array
return string
    protected function parseQuery($url, $parameters = [])
    {
        if ($query = substr(strstr($url, '?'), 1)) {
            parse_str($query, $params);
            $url = strstr($url, '?', true);
            $parameters = array_replace($parameters, $params);
        }
        if ($query = http_build_query($parameters, '', '&')) {
            $url .= '?' . $query;
        }
        return $url;
    }