Returns route prefix depending on the configuration.
@return string Route prefix
346436
public function getRoutePrefix()
    {
        if (!$this->_routePrefix) {
            $this->_routePrefix = Configs::instance()->advanced ? self::PREFIX_ADVANCED : self::PREFIX_BASIC;
        }
        return $this->_routePrefix;
    }
1267909
public function isPrefix()
    {
        $params = $this->Controller->request->params;
        if (key_exists('prefix', $params)) {
            $prefix = $params['prefix'];
            if ($prefix) {
                return true;
            }
        }
        return false;
    }
1286483
protected function resolveModuleName()
    {
        if (!isset($this->routeGroup)) {
            return '';
        }
        return join('.', [str_replace('/', '.', $this->routeGroup), self::$withSuffix]);
    }
19247
public function buildRoutePattern()
	{
		$path = $this->prefix ? rtrim($this->prefix . '/' . $this->route, '/') : $this->route;

		return '~^' . preg_replace_callback(self::VAR_PATTERN, function($matches) {
			$this->parameter[] = $key = $matches[1];

			// Shorthand validation only if not set using the validation-method
			if (isset($matches[2]) && !isset($this->parameterPattern[$key])) {
				$this->parameterPattern[$key] = $matches[2];
			}
			return $this->buildParameterPattern($key);
		}, $path) . ($this->terminated ? '$' : '') . '~i';

	}
114674
private function getRoute()
    {
        $route = $this->route;
        $first = substr($route, 0, 1);
        $last = substr($route, -1);
        if($first == "/") {
            $route = substr($route, 1);
        }
        if($last == "/") {
            $route = substr($route, 0, -1);
        }
        $this->resource = $route;
        
    }
125775
function getExpressRoutePrefix(site) {
  let prefix = site.host;

  if (site.path.length > 1) {
    prefix += site.path;
  }

  return prefix;
}
1284938
final public function prefix($prefix, bool $trailingSlashOnRoot = true)
    {
        if (!\is_array($prefix)) {
            $this->route->addPrefix($prefix);
            if (!$trailingSlashOnRoot) {
                $rootPath = (new Route(trim(trim($prefix), '/').'/'))->getPath();
                foreach ($this->route->all() as $route) {
                    if ($route->getPath() === $rootPath) {
                        $route->setPath(rtrim($rootPath, '/'));
                    }
                }
            }
        } else {
            foreach ($prefix as $locale => $localePrefix) {
                $prefix[$locale] = trim(trim($localePrefix), '/');
            }
            foreach ($this->route->all() as $name => $route) {
                if (null === $locale = $route->getDefault('_locale')) {
                    $this->route->remove($name);
                    foreach ($prefix as $locale => $localePrefix) {
                        $localizedRoute = clone $route;
                        $localizedRoute->setDefault('_locale', $locale);
                        $localizedRoute->setDefault('_canonical_route', $name);
                        $localizedRoute->setPath($localePrefix.(!$trailingSlashOnRoot && '/' === $route->getPath() ? '' : $route->getPath()));
                        $this->route->add($name.'.'.$locale, $localizedRoute);
                    }
                } elseif (!isset($prefix[$locale])) {
                    throw new \InvalidArgumentException(sprintf('Route "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $name, $locale));
                } else {
                    $route->setPath($prefix[$locale].(!$trailingSlashOnRoot && '/' === $route->getPath() ? '' : $route->getPath()));
                    $this->route->add($name, $route);
                }
            }
        }

        return $this;
    }
1366109
public function prefix($path)
    {
        $path = $this->cleanPath($path);
        return preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches) ? $matches['prefix'] : null;
    }
866373
public function getRoute() {
        if (is_null($this->route)) {
            $this->route = Yii::$app->request->getHostInfo() . '/' . Yii::$app->request->getPathInfo();
        }
        return $this->route;
    }
399654
public static function prefix($prefix = '') {
        $that = self::driver();
        $that->prefix($prefix);
        if (empty($prefix)) {
            return $that->config['prefix'];
        }
        $that->config['prefix'] = $prefix;
    }
1103554
public function getPermissionName($route)
    {
        if (self::PREFIX_BASIC == $this->routePrefix) {
            return self::PREFIX_BASIC . trim($route, self::PREFIX_BASIC);
        } else {
            return self::PREFIX_ADVANCED . ltrim(trim($route, self::PREFIX_BASIC), self::PREFIX_ADVANCED);
        }
    }
1196584
public function getRegex(): string
	{
		$route = $this->getRoute();

		if(strpos($route, '?'))
		{
			$route = preg_replace('/\/{(\w+)}\?/', '(?:/{$1})?', $route);
		}

		if(!empty($this->patterns))
		{
			foreach($this->patterns as $key => $pattern)
			{
				$route = str_replace('{' . $key . '}', '(?P<' . $key . '>' . $pattern . ')', $route);
			}
		}

		$route = preg_replace('/{((\d*[a-z_]\d*)+)}/i', '(?P<$1>[^/]++)', $route);

		if($this->hasTrailingSlash)
		{
			$route .= '?';
		}

		return '#^' . $route . '$#su';
	}
1257993
protected function getPrefixName($method)
    {
        $prefix = $this->route->getCurrentRoute()->getPrefix();
        $prefix = str_replace('/', '.', $prefix);
        $prefix = preg_replace('/\b\.' . $method . '\b/', '', $prefix);
        $prefix = preg_replace('/\b' . $method . '\.\b/', '', $prefix);

        return $prefix;
    }
237017
protected function getCurrentRoute(): string
    {
        $request = resolve(HttpRequest::class);
        $method = strtoupper($request->getMethod());
        $path = ltrim($request->path(), '/');
        $host = $request->getHost();

        ! is_null($host) && $host = rtrim($host, '/');

        return "{$method} {$host}/{$path}";
    }
1085011
private function getDefaultRoutePath(): string
    {
        $pattern = $this
            ->adminConfiguration
            ->getParameter('routing_url_pattern')
        ;
        $path = str_replace('{admin}', $this->adminName, $pattern);
        $path = str_replace('{action}', $this->actionName, $path);

        if (in_array($this->actionName, ['edit', 'delete'])) {
            $path .= '/{id}';
        }

        return $path;
    }
277608
public function getRouteIdentifierPrefix()
    {
        if ($this->routeIdentifierPrefix === null) {
            $this->routeIdentifierPrefix = strtolower($this->getModuleNamespace() . '/' . $this->getClassNameWithoutNamespace());
        }
        return $this->routeIdentifierPrefix;
    }
400057
public function getRoute() {
        if ($this->route === null && $this->isIgnoredRoute() === false) {
            $this->route = $this->routes->matchRoute($this);
        }

        return $this->route;
    }