URL Generator.

@param string $path

@return string
779334
protected function url($path, $label, $parent = null)
    {
        if ($this->config['generate_url']) {
            if ($this->route) {
                if (array_has($this->route, 'callback')) {
                    if(is_array($parent)) $parent = (object)$parent;
                    return call_user_func_array($this->route['callback'], [$path, $label, $parent]);
                } else {
                    end($this->route);
                    $param = current($this->route);
                    $name = key($this->route);
                    return URL::route($name, [$param => $path]);
                }
            }

            return URL::to($path);
        }

        return '/'.$path;
    }
335919
protected function getPath($path)
    {
        $hasHttp = strpos($path, 'http');
        if (false === $hasHttp || $hasHttp !== 0) {
            return $this->options['base_url'] . $path;
        }

        return $path;
    }
167047
public function url($path, array $params = [])
    {
        $urlBuilder = UrlBuilderFactory::create($this->config['base_url'], $this->config['sign_key']);

        return $urlBuilder->getUrl($path, $params);
    }
657118
public function getUrlFromPath($path)
    {
        $path = ltrim($path, '/');

        $host = 'https://'.($this->use_sandbox ? 'sandbox-' : '').'api.uber.com';

        return $host.($this->version ? '/'.$this->version : '').'/'.$path;
    }
207807
public function url($path = null)
    {
        $routeAction = 'Cms\Classes\CmsController@run';

        if (self::$actionExists === null) {
            self::$actionExists = Route::getRoutes()->getByAction($routeAction) !== null;
        }

        if (substr($path, 0, 1) == '/') {
            $path = substr($path, 1);
        }

        if (self::$actionExists) {
            return Url::action($routeAction, ['slug' => $path]);
        }

        return Url::to($path);
    }
982288
public function getUrl($path)
    {
        if (! $this->host) {
            throw new BadMethodCallException("The 'host' key must be set in the b2 storage adapter to fetch URLs.");
        }

        return 'https://' . $this->host . '/file/' . $this->bucketName . '/' . $path;
    }
1061459
public function path($path, $args = [])
    {
        if (is_array($path)) {
            $path = array_merge($path, $args);
        } elseif ($args !== []) {
            $path = array_merge([$path], $args);
        }

        return Url::to($path);
    }
397095
public function apiUrl(string $path = '', bool $withPropagation = true): string
    {
        $path = ($path ? '/'.ltrim($path, '/') : '');
        $resourcePath = rtrim($this->resourcePath(), '/').'/'.$this->id().$path;

        if (!$this->hasResourceOwner() || !$withPropagation) {
            return $resourcePath;
        }

        return $this->resourceOwner()->apiUrl($resourcePath);
    }
205130
private function generateUrl($path, $prepend = '')
    {
        // if the package is surpassed, then return the same $path
        // to load the asset from the localhost
        if (isset($this->configurations['bypass']) && $this->configurations['bypass']) {
            return Request::root().'/'.$path;
        }

        if (!isset($path)) {
            throw new EmptyPathException('Path does not exist.');
        }

        // Add version number
        //$path = str_replace(
        //    "build",
        //    $this->configurations['providers']['aws']['s3']['version'],
        //    $path
        //);

        // remove slashes from begging and ending of the path
        // and append directories if needed
        $clean_path = $prepend.$this->helper->cleanPath($path);

        // call the provider specific url generator
        return $this->provider->urlGenerator($clean_path);
    }
958729
public function createCallbackURL($path)
    {
        $uri = (new UriFactory)->createFromSuperGlobalArray($_SERVER);
        $uri->setPath($path);
        $uri->setQuery('');

        return $uri->getAbsoluteUri();
    }
654344
public function pathToUrl($path) {
        if (empty($this->config['url_prefix'])) return '/'.$path;
        else if (empty($this->config['path'])) return rtrim($this->config['url_prefix'], '/').'/'.$path;
        else return rtrim($this->config['url_prefix'], '/').'/'.$this->relativePath($path);
    }
1107580
public function getPrivateUrl($path)
    {
        $getPolicy = new \Qiniu_RS_GetPolicy();
        return $getPolicy->MakeRequest($this->getUrl($path), null);
    }
641961
public static function makeGoodPathHTTP($path)
    {

        $path = (string)$path;
        $path = str_replace('\\', '/', $path);
        $path = (string)$path;

        return $path;
    }
373701
public function getDevServerURL($path = null)
    {
        // Using Development Environment?
        
        if (!Director::isDev()) {
            return;
        }
        
        // Obtain Development Server Config:
        
        if ($config = $this->getDevServerConfig()) {
            
            if (isset($config['host']) && isset($config['port'])) {
                
                // Auto Host Mode:
                
                if ($config['host'] === 'auto') {
                    $config['host'] = Director::host();
                }
                
                // Define Protocol:
                
                $protocol = function ($config) {
                    if (isset($config['https']) && $config['https'] !== 'auto') {
                        return sprintf('%s:', $config['https'] ? 'https' : 'http');
                    }
                };
                
                // Answer URL String:
                
                return sprintf(
                    '%s//%s:%d/%s',
                    $protocol($config),
                    $config['host'],
                    $config['port'],
                    $path
                );
                
            }
            
        }
    }
1250764
protected function fetchUrl($path)
	{
		// Append the path with output format
		$path .= '&format=xml';

		$uri = new Uri($this->options->get('api.url') . '/api.php' . $path);

		if ($this->options->get('api.username', false))
		{
			$uri->setUser($this->options->get('api.username'));
		}

		if ($this->options->get('api.password', false))
		{
			$uri->setPass($this->options->get('api.password'));
		}

		return (string) $uri;
	}
363658
protected function getLocalUrl($path)
    {
        $config = $this->driver->getConfig();

        // If an explicit base URL has been set on the disk configuration then we will use
        // it as the base URL instead of the default path. This allows the developer to
        // have full control over the base path for this filesystem's generated URLs.
        if ($config->has('url')) {
            return $this->concatPathToUrl($config->get('url'), $path);
        }

        $path = '/storage/'.$path;

        // If the path contains "storage/public", it probably means the developer is using
        // the default disk to generate the path instead of the "public" disk like they
        // are really supposed to use. We will remove the public from this path here.
        if (Str::contains($path, '/storage/public/')) {
            return Str::replaceFirst('/public/', '/', $path);
        }

        return $path;
    }
75989
public function getUrlForRelativePath($path)
    {
        return $this->getUrlForPath(
            $this->_joinPathComponents($this->getPath(), ltrim($path, '/')));
    }