public function addPath($relativePath)
    {
        if (!$relativePath || $relativePath == '/') {
            return $this;
        }

        // Add a leading slash if needed
        if ($relativePath[0] != '/') {
            $relativePath = '/' . $relativePath;
        }

        return $this->setPath(str_replace('//', '/', $this->getPath() . $relativePath));
    }
public function addPath($relativePath)
    {
        if (!$relativePath || $relativePath == '/') {
            return $this;
        }

        // Add a leading slash if needed
        if ($relativePath[0] != '/') {
            $relativePath = '/' . $relativePath;
        }

        return $this->setPath(str_replace('//', '/', $this->getPath() . $relativePath));
    }
public function addPath ( $ relativePath ) { if ( ! $ relativePath || $ relativePath == '/' ) { return $ this ; } // Add a leading slash if needed if ( $ relativePath [ 0 ] != '/' ) { $ relativePath = '/' . $ relativePath ; } return $ this -> setPath ( str_replace ( '//' , '/' , $ this -> getPath ( ) . $ relativePath ) ) ; }
Add a relative path to the currently set path

@param string $relativePath Relative path to add

@return Url
Add a relative path to the currently set path