public static function setUrlParams($url = false)
    {
        $url = $url !== false ? $url : self::getCurrentPage();

        if (strpos($url, '?') == false && strpos($url, '&') != false) {
            $url = preg_replace('/&/', '?', $url, 1);
            $parts = parse_url($url);
            $query = isset($parts['query']) ? $parts['query'] : '';

            parse_str($query, $query);
        }

        foreach (isset($query) ? $query : [] as $key => $value) {
            $_GET[$key] = $value;
        }

        return explode('?', $url)[0];
    }