You are here

public function Crawler::addNode in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Crawler.php \Symfony\Component\DomCrawler\Crawler::addNode()

Adds a \DOMNode instance to the list of nodes.

Parameters

\DOMNode $node A \DOMNode instance:

3 calls to Crawler::addNode()
Crawler::add in vendor/symfony/dom-crawler/Crawler.php
Adds a node to the current list of nodes.
Crawler::addDocument in vendor/symfony/dom-crawler/Crawler.php
Adds a \DOMDocument to the list of nodes.
Crawler::addNodeList in vendor/symfony/dom-crawler/Crawler.php
Adds a \DOMNodeList to the list of nodes.

File

vendor/symfony/dom-crawler/Crawler.php, line 299

Class

Crawler
Crawler eases navigation of a list of \DOMElement objects.

Namespace

Symfony\Component\DomCrawler

Code

public function addNode(\DOMNode $node) {
  if ($node instanceof \DOMDocument) {
    $this
      ->attach($node->documentElement);
  }
  else {
    $this
      ->attach($node);
  }
}