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

Skip to content

Commit d3f0ed5

Browse files
committed
[DomCrawler] Document UriExpander
1 parent 4d257ca commit d3f0ed5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

components/dom_crawler.rst

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

623+
Expanding URI
624+
~~~~~~~~~~~~~
625+
626+
.. versionadded:: 5.1
627+
628+
The UriExpander helper was added in Symfony 5.1.
629+
630+
The :class:`Symfony\\Component\\DomCrawler\\UriExpander` class provides method
631+
to expand a relative link::
632+
633+
UriExpander::expand($uri, $currentUri);
634+
// For example:
635+
UriExpander::expand('/foo', 'http://localhost/bar/foo/'); // => 'http://localhost/foo'
636+
UriExpander::expand('?a=b', 'http://localhost/bar#foo'; // => 'http://localhost/bar?a=b'
637+
UriExpander::expand('../../', 'http://localhost/'; // => http://localhost/'
638+
623639
Learn more
624640
----------
625641

0 commit comments

Comments
 (0)