Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DomCrawler] Document UriResolver #13054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
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