You are here

public function Link::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/dom-crawler/Link.php \Symfony\Component\DomCrawler\Link::__construct()
  2. 8 core/lib/Drupal/Core/Link.php \Drupal\Core\Link::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Link.php \Symfony\Component\DomCrawler\Link::__construct()

Constructor.

Parameters

\DOMElement $node A \DOMElement instance:

string $currentUri The URI of the page where the link is embedded (or the base href):

string $method The method to use for the link (get by default):

Throws

\InvalidArgumentException if the node is not a link

1 call to Link::__construct()
Form::__construct in vendor/symfony/dom-crawler/Form.php
Constructor.
1 method overrides Link::__construct()
Form::__construct in vendor/symfony/dom-crawler/Form.php
Constructor.

File

vendor/symfony/dom-crawler/Link.php, line 45

Class

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

Namespace

Symfony\Component\DomCrawler

Code

public function __construct(\DOMElement $node, $currentUri, $method = 'GET') {
  if (!in_array(strtolower(substr($currentUri, 0, 4)), array(
    'http',
    'file',
  ))) {
    throw new \InvalidArgumentException(sprintf('Current URI must be an absolute URL ("%s").', $currentUri));
  }
  $this
    ->setNode($node);
  $this->method = $method ? strtoupper($method) : null;
  $this->currentUri = $currentUri;
}