Skip to content

Commit

Permalink
[DomCrawler] Document UriResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrixx authored and OskarStark committed Feb 11, 2020
1 parent 4d257ca commit 4ce42c9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions components/dom_crawler.rst
Expand Up @@ -620,6 +620,21 @@ the whole form or specific field(s)::
$form->disableValidation();
$form['country']->select('Invalid value');

Resolving URI
~~~~~~~~~~~~~

.. versionadded:: 5.1

The `UriResolver` helper was added in Symfony 5.1.

The :class:`Symfony\\Component\\DomCrawler\\UriResolver` class takes an URI
(relative, absolute, fragment, etc.) and turns it into an absolute URI against
another given base URI.::

UriResolver::resolve('/foo', 'http://localhost/bar/foo/'); // => 'http://localhost/foo'
UriResolver::resolve('?a=b', 'http://localhost/bar#foo'); // => 'http://localhost/bar?a=b'
UriResolver::resolve('../../', 'http://localhost/'); // => http://localhost/'

Learn more
----------

Expand Down

0 comments on commit 4ce42c9

Please sign in to comment.