From 4ce42c965c47af5c65d3c3688a679a37127ae6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 5 Feb 2020 11:01:00 +0100 Subject: [PATCH] [DomCrawler] Document UriResolver --- components/dom_crawler.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 8bc6a093fc8..ad5e2dd27c8 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -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 ---------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy