W3cubDocs

/Symfony 4.1

Link

class Link extends AbstractUriElement

Link represents an HTML link (an HTML a, area or link tag).

Properties

protected DOMElement $node from AbstractUriElement
protected string $method from AbstractUriElement
protected string $currentUri from AbstractUriElement

Methods

__construct(DOMElement $node, string $currentUri, string|null $method = 'GET') from AbstractUriElement
DOMElement getNode()

Gets the node associated with this link.

from AbstractUriElement
string getMethod()

Gets the method associated with this link.

from AbstractUriElement
string getUri()

Gets the URI associated with this link.

from AbstractUriElement
string getRawUri()

Returns raw URI data.

string canonicalizePath(string $path)

Returns the canonicalized URI path (see RFC 3986, section 5.2.4).

from AbstractUriElement
setNode(DOMElement $node)

Sets current \DOMElement instance.

Details

__construct(DOMElement $node, string $currentUri, string|null $method = 'GET')

Parameters

DOMElement $node A \DOMElement instance
string $currentUri The URI of the page where the link is embedded (or the base href)
string|null $method The method to use for the link (GET by default)

Exceptions

InvalidArgumentException if the node is not a link

DOMElement getNode()

Gets the node associated with this link.

Return Value

DOMElement A \DOMElement instance

string getMethod()

Gets the method associated with this link.

Return Value

string The method

string getUri()

Gets the URI associated with this link.

Return Value

string The URI

protected string getRawUri()

Returns raw URI data.

Return Value

string

protected string canonicalizePath(string $path)

Returns the canonicalized URI path (see RFC 3986, section 5.2.4).

Parameters

string $path URI path

Return Value

string

protected setNode(DOMElement $node)

Sets current \DOMElement instance.

Parameters

DOMElement $node A \DOMElement instance

Exceptions

LogicException If given node is not an anchor

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/DomCrawler/Link.html