Skip to content

Commit 4ce42c9

Browse files
lyrixxOskarStark
authored andcommitted
[DomCrawler] Document UriResolver
1 parent 4d257ca commit 4ce42c9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

components/dom_crawler.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,21 @@ the whole form or specific field(s)::
620620
$form->disableValidation();
621621
$form['country']->select('Invalid value');
622622

623+
Resolving URI
624+
~~~~~~~~~~~~~
625+
626+
.. versionadded:: 5.1
627+
628+
The `UriResolver` helper was added in Symfony 5.1.
629+
630+
The :class:`Symfony\\Component\\DomCrawler\\UriResolver` class takes an URI
631+
(relative, absolute, fragment, etc.) and turns it into an absolute URI against
632+
another given base URI.::
633+
634+
UriResolver::resolve('/foo', 'http://localhost/bar/foo/'); // => 'http://localhost/foo'
635+
UriResolver::resolve('?a=b', 'http://localhost/bar#foo'); // => 'http://localhost/bar?a=b'
636+
UriResolver::resolve('../../', 'http://localhost/'); // => http://localhost/'
637+
623638
Learn more
624639
----------
625640

0 commit comments

Comments
 (0)