Get current uri.

@param  bool $absolute
@return string
483269
public function getCurrentUri($absolute = true)
    {
        if ($absolute) {
            return $this->get('scheme') . $this->get('name') . $this->get('uri');
        } else {
            return $this->get('uri');
        }
    }
1217686
public static function getAbsoluteUri(string $uri = null) : string
    {
        $uri = new self($uri);

        return $uri->get(false);
    }
146083
public function getBasePath($absolute = false)
    {
        $path = array();
        if ($absolute) {
            if (($basePath = Yii::getPathOfAlias($this->basePath)) === false && is_dir($this->basePath)) {
                $basePath = realpath($this->basePath);
            }
            $path[] = $basePath;
        }
        $path[] = $this->fileDir;
        return implode('/', $path);
    }
1082050
public function getBaseUri()
    {
        if (is_null($this->baseUri)) {
            $this->baseUri = $this->guessBaseUri();
        }

        return $this->baseUri;
    }
1132425
protected function getBaseUrl()
    {
        $uri = '';

        $scheme = $this->getScheme();
        if ($scheme !== '') {
            $uri .= $scheme . ':';
        }

        $authority = $this->getAuthority();
        if ($authority !== '' || $scheme === 'file') {
            $uri .= '//' . $authority;
        }

        return $uri;
    }
509420
private function getReferenceType($absoluteUrlOption = false)
    {
        return ($this->generatedRouteHost || $absoluteUrlOption)
            ? UrlGeneratorInterface::ABSOLUTE_URL
            : UrlGeneratorInterface::ABSOLUTE_PATH;
    }
621705
protected function getCurrentUri()
  {
    // Get the current Request URI and remove rewrite base path from it (= allows one to run the router in a sub folder)
    $uri = substr($_SERVER['REQUEST_URI'], strlen($this->getBasePath()));
    // Don't take query params into account on the URL
    if (strstr($uri, '?')) {
      $uri = substr($uri, 0, strpos($uri, '?'));
    }
    // Remove trailing slash + enforce a slash at the start
    return '/' . trim($uri, '/');
  }
398382
public function uri($include_root = true)
    {
        if ($include_root) {
            return $this->uri;
        }

        return str_replace($this->root_path, '', $this->uri);
    }
573454
public function uri($query = false)
    {
        return rtrim($this->baseName(), '/') . '/' . ltrim($this->path($query), '/');
    }
1077403
public function getBaseUrl($absolute = false)
    {
        $url = array();
        if ($absolute) {
            $url[] = $this->baseUrl !== null ? rtrim($this->baseUrl, '/') : Yii::app()->request->baseUrl;
        }
        $url[] = $this->fileDir;
        return rtrim(implode('/', $url), '/');
    }
1262961
public function absolutePath($theme = null)
    {
        if (is_null($theme)) {
            $theme = $this->getCurrent();
        }

        return $this->config['paths']['absolute'].'/'.$theme;
    }
387460
public function getBasePath() : string
    {
        $baseUri = $this->getBase();
        $path = ltrim($this->getPath(), "/");

        $absoluteUri = $baseUri . (($path === "") ? "" : "/" . $path);

        return $absoluteUri;
    }
27405
private function getPathRelativeToProjectDir(string $absolute): string
    {
        $projectDir = $this->kernel->getProjectDir();
        $relative = str_replace($projectDir, '', $absolute);
        $relative = ltrim($relative, '/');

        return $relative;
    }
1241209
public function getUri()
    {
        $uri = rtrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH),'/');
        $baseUri = $this->getBaseUri();
        $uri = str_replace($baseUri, '', $uri)?: '/';

        return $uri;
    }
940891
public static function getActiveThemeUrl($resource, $absolute = false) {
		$activeTheme = ThemesManager::getActiveTheme ();
		return self::getThemeUrl ( $activeTheme, $resource, $absolute );
	}
803880
public static function getThemeUrl($theme, $resource, $absolute = false) {
		if ($absolute) {
			return self::$siteURL . self::ASSETS_FOLDER . $theme . '/' . $resource;
		}
		return ltrim ( self::ASSETS_FOLDER, '/' ) . $theme . '/' . $resource;
	}
980837
public static function getUrl($resource, $absolute = false) {
		if (strpos ( $resource, '//' ) !== false) {
			return $resource;
		}
		if ($absolute) {
			return self::$siteURL . self::ASSETS_FOLDER . $resource;
		}
		return ltrim ( self::ASSETS_FOLDER, '/' ) . $resource;
	}