public function resolve($uri, $baseUri = null)
    {
        $components = $this->parse($uri);
        $path = $components['path'];

        if ((array_key_exists('scheme', $components)) && ('http' === $components['scheme'])) {
            return $uri;
        }

        $baseComponents = $this->parse($baseUri);
        $basePath = $baseComponents['path'];

        $baseComponents['path'] = UriResolver::combineRelativePathWithBasePath($path, $basePath);

        return $this->generate($baseComponents);
    }
public function resolve($uri, $baseUri = null)
    {
        $components = $this->parse($uri);
        $path = $components['path'];

        if ((array_key_exists('scheme', $components)) && ('http' === $components['scheme'])) {
            return $uri;
        }

        $baseComponents = $this->parse($baseUri);
        $basePath = $baseComponents['path'];

        $baseComponents['path'] = UriResolver::combineRelativePathWithBasePath($path, $basePath);

        return $this->generate($baseComponents);
    }
public function resolve ( $ uri , $ baseUri = null ) { $ components = $ this -> parse ( $ uri ) ; $ path = $ components [ 'path' ] ; if ( ( array_key_exists ( 'scheme' , $ components ) ) && ( 'http' === $ components [ 'scheme' ] ) ) { return $ uri ; } $ baseComponents = $ this -> parse ( $ baseUri ) ; $ basePath = $ baseComponents [ 'path' ] ; $ baseComponents [ 'path' ] = UriResolver :: combineRelativePathWithBasePath ( $ path , $ basePath ) ; return $ this -> generate ( $ baseComponents ) ; }
Resolves a URI

@param string $uri     Absolute or relative
@param string $baseUri Optional base URI

@return string
Resolves a URI