Skip to content

Commit be8b2b7

Browse files
committed
feature #13054 [DomCrawler] Document UriResolver (lyrixx)
This PR was squashed before being merged into the master branch (closes #13054). Discussion ---------- [DomCrawler] Document UriResolver fixes #13040 Commits ------- 4ce42c9 [DomCrawler] Document UriResolver
2 parents 9e1f8ac + 4ce42c9 commit be8b2b7

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)