public function url($params = [], $routeName = null, $queryParams = [], $qsAppend = false)
        {
            $urlBase = $this->config('url.root', '');

            // HTTPS Secure URL?
            $isSecure = false;

            if (isset($params['secure']) && true === $params['secure']) {
                $isSecure = true;
                $urlBase = str_replace('http:', 'https:', $urlBase);
                unset($params['secure']);
            }

            // Detemine what URL is from param types
            if (is_string($params)) {
                $routeName = $params;
                $params = [];
            } elseif (!Arrays::is($params)) {
                throw new Exception("First parameter of URL must be array or string route name");
            }


            // Is there query string data?
            $queryString = "";
            $request = $this->request();

            if (true === $qsAppend && $request->query()) {
                $queryParams = array_merge($request->query(), $queryParams);
            }

            if (count($queryParams) > 0) {
                // Build query string from array $qsData
                $queryString = http_build_query($queryParams, '', '&amp;');
            } else {
                $queryString = false;
            }

            // Get URL from router object by reverse match
            $url = str_replace('%2f', '/', strtolower($this->router()->url($params, $routeName)));

            // Use query string if URL rewriting is not enabled
            if ($this->config('url.rewrite')) {
                $url = $urlBase . $url . (($queryString !== false) ? '?' . $queryString : '');
            } else {
                $url = $urlBase . '?u=' . $url . (($queryString !== false) ? '&amp;' . $queryString : '');
            }

            // Return fully assembled URL
            $url = str_replace('///', '/', $url);

            return $url;
        }