innmind/url-resolver

Library to resolve relative urls to absolute ones

5.1.0 2023-09-16 15:03 UTC

This package is auto-updated.

Last update: 2024-10-16 17:08:29 UTC


README

Build Status codecov Type Coverage

Allow to build an absolute url from a source url and a destination.

Example:

use Innmind\UrlResolver\UrlResolver;
use Innmind\Url\Url;

$resolve = UrlResolver::of('http', 'https');

$url = $resolve(
    Url::of('http://example.com/foo/'),
    Url::of('./bar/baz?query=string#fragment'),
);
// $url resolves to http://example.com/foo/bar/baz?query=string#fragment