Gives you the current page URL

@return string
329120
public function getUrl()
    {
        $protocol = strpos(strtolower($this->PATH_INFO), 'https') === false ? 'http' : 'https';

        return $protocol . '://' . $this->getHost();
    }
960377
public static function getCurrentUrl()
    {
        if (isset($_SERVER['HTTPS']) &&
            ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
            isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
            $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
            $protocol = 'https';
        }
        else {
            $protocol = 'http';
        }

        return "$protocol://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    }
847415
function current()
    {
        if (!isset($this->_curPage)
            || $this->_curPage->getPage() != $this->_position
        ) {
            $this->_curPage = $this->_pages->get($this->_position);
        }
        return $this->_curPage;
    }
400561
private function getCurrentPath()
    {
        if (is_null($this->currentPath)) {
            $this->currentPath = $this->str($this->httpRequest()->getCurrentUrl(true)->getPath());
        }

        return $this->currentPath;
    }
729086
protected function _getCurrentUrl() {
        $url = $this->view->fullUrl($this->view->url());
        $quesPos = strpos($url, '?');
        if ($quesPos !== false) {
            $url = substr($url, 0, $quesPos);
        }
        return $url;
    }
200098
public static function getCurrentUrl(): string
    {
        $siteUrl = self::getSiteUrl();
        
        $request = self::getServerVariable('REQUEST_URI', self::getServerVariable('PHP_SELF', ''));
        $query = self::getQueryString();
        
        $indexPhpFound = strpos($request, INDEX_FILE);
        if (!USE_INDEX_FILE && ($indexPhpFound === 0 || $indexPhpFound === 1)) {
            // remove index.php
            $request = str_replace(INDEX_FILE, '', $request);
        }
        
        $currentUrl = $siteUrl . $request;
        if (!empty($query) && strpos($request, $query) === false) {
            $currentUrl .= '?' . $query;
        }
        
        return preg_replace("#([^:])//+#", "$1/", $currentUrl);
    }
211315
private function getCurrentUrlPath()
    {
        if ($this->path) {
            return $this->path;
        }

        /**
         * check if the path is empty otherwise
         * set it with the server variable and if there's no server variable set it as the default delimiter [/] the root
         */
        $this->path = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null;
        $this->urlPart = $this->parsePath($this->path);

        return $this->path;
    }
590453
public function getUrl() {
		
		$sefParams = array();
		$cgiParams = array();
		
		// queue all parameters
		foreach ($this->vars as $key=>$val) {
			if (is_int($key)) {
				$sefParams[] = $val;
			} else {
				$cgiParams[$key] = $val;
			}
		}

		$url = $this->module . '/' . $this->action;
		
		// add slashed params
		if (count($sefParams)) {
			$url .= '/' . implode('/', $sefParams);
		}

		// add ordering
		if ($this->order) {
			$url .= '/order-' . $this->order;
		}
		
		// add pagination
		if ($this->page) {
			$url .= '/page-' . $this->getPage();
		}
		
		// add associative params
		if (count($cgiParams)) {
			$url .= '?' . http_build_query($cgiParams);
		}

		return $url;
		
	}
23604
public function url()
    {
        if ($this->{self::ATTR_PRIMARY_URI} === null) {
            return;
        }

        if ($this->primaryUrl === null) {
            $this->primaryUrl = new URL([
                'page'       => $this,
                'location'   => $this->{self::ATTR_PRIMARY_URI},
                'is_primary' => true,
            ]);
        }

        return $this->primaryUrl;
    }
26413
public static function getCurrentRoute()
    {
        if (!static::$currentRoute) {
            $uri = Grav::instance()['uri'];
            static::$currentRoute = RouteFactory::createFromParts($uri->toArray());
        }

        return static::$currentRoute;
    }
144126
public static function getCurrentURL(): Url
    {
        if (static::$currentUrl instanceof Url) {
            return static::$currentUrl;
        }

        if (Application::isCli()) {
            throw new ApplicationException('Can not get current URL while running in CLI mode; URL doesn\'t exist in CLI mode');
        }

        static::$currentUrl = new Url(static::getDomainWithSchema() . static::getUri());
        return static::$currentUrl;
    }
32930
public function getBackUrl()
    {
        $url = null;
        if (null !== $this->_coreRegistry->registry('product')) {
            // we are on a product page
            $currentCategory = $this->getCurrentCategory();
            $url = $currentCategory->getUrl();
        } else {
            // we are on a category page, or somewhere else
            $parentCategory = $this->getParentCategory();
            if (null !== $parentCategory) {
                $url = $parentCategory->getUrl();
            }
        }

        if (null === $url) {
            $url = $this->_storeManager->getStore()->getBaseUrl();
        }

        return $url;
    }
774829
public static function getCurrentUrl()
    {
        return self::getCurrentScheme() . '://'
        . self::getCurrentHost()
        . self::getCurrentScriptName(false)
        . self::getCurrentQueryString();
    }
567108
public function nextPageUrl()
	{
		if ( $this->lastPage() > $this->currentPage() )
			return $this->url( $this->currentPage() + 1 );

		return null;
	}
542073
public function getCurrentPageNumber()
    {
        $optionsRenderer = $this->getOptionsRenderer();
        $parameterNames = $optionsRenderer['parameterNames'];

        $request = $this->getRequest();
        if ($request instanceof HttpRequest) {
            $this->currentPageNumber = (int) $request->getPost(
                $parameterNames['currentPage'],
                $request->getQuery($parameterNames['currentPage'], 1)
            );
        }

        return (int) $this->currentPageNumber;
    }
25060
public function nextUrl()
    {
        $next = $this->current() + 1;
        return ($next <= $this->pages()) ? $this->parseUrl($next) : "";
    }
1224343
public function getCurrentUrl() {
        $script = self::getScriptName();
        if ( $script === false ) return false; 
        $pieces = $this->apphome;
        if ( $this->apphome ) {
            $pieces = parse_url($this->apphome);
        }
        // We only take scheme, host, and port from wwwroot / apphome
        if ( ! isset($pieces['scheme']) ) return false;
        $retval = $pieces['scheme'].'://'.$pieces['host'];
        if ( isset($pieces['port']) ) $retval .= ':'.$pieces['port'];
        return $retval . $script;
    }