public function toAbsoluteUrl(Url $root = null)
    {
        $root = $this->getRoot() ?: $root;
        if (!$root->isUrlAbsolute()) {
            throw new \InvalidArgumentException();
        }
        if (!$this->isUrlAbsolute()) {
            $this->setScheme($root->getScheme());
            $this->setHost($root->getHost());
            if (!$this->isPathAbsolute()) {
                $path = $root->getPath();
                $path = substr($path, 0, strrpos($path, '/') + 1);
                $this->setPath($path . $this->getPath());
            }
        }
        return $this;
    }
public function toAbsoluteUrl(Url $root = null)
    {
        $root = $this->getRoot() ?: $root;
        if (!$root->isUrlAbsolute()) {
            throw new \InvalidArgumentException();
        }
        if (!$this->isUrlAbsolute()) {
            $this->setScheme($root->getScheme());
            $this->setHost($root->getHost());
            if (!$this->isPathAbsolute()) {
                $path = $root->getPath();
                $path = substr($path, 0, strrpos($path, '/') + 1);
                $this->setPath($path . $this->getPath());
            }
        }
        return $this;
    }
public function toAbsoluteUrl ( Url $ root = null ) { $ root = $ this -> getRoot ( ) ? : $ root ; if ( ! $ root -> isUrlAbsolute ( ) ) { throw new \ InvalidArgumentException ( ) ; } if ( ! $ this -> isUrlAbsolute ( ) ) { $ this -> setScheme ( $ root -> getScheme ( ) ) ; $ this -> setHost ( $ root -> getHost ( ) ) ; if ( ! $ this -> isPathAbsolute ( ) ) { $ path = $ root -> getPath ( ) ; $ path = substr ( $ path , 0 , strrpos ( $ path , '/' ) + 1 ) ; $ this -> setPath ( $ path . $ this -> getPath ( ) ) ; } } return $ this ; }
Obtiene la URL absoluta de un path.
@param Url $root
@param Url $url
@return string La URL absoluta.
Obtiene la URL absoluta de un path .