You are here

protected function Client::createCrawlerFromContent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/browser-kit/Client.php \Symfony\Component\BrowserKit\Client::createCrawlerFromContent()

Creates a crawler.

This method returns null if the DomCrawler component is not available.

Parameters

string $uri A URI:

string $content Content for the crawler to use:

string $type Content type:

Return value

Crawler|null

1 call to Client::createCrawlerFromContent()
Client::request in vendor/symfony/browser-kit/Client.php
Calls a URI.

File

vendor/symfony/browser-kit/Client.php, line 396

Class

Client
Client simulates a browser.

Namespace

Symfony\Component\BrowserKit

Code

protected function createCrawlerFromContent($uri, $content, $type) {
  if (!class_exists('Symfony\\Component\\DomCrawler\\Crawler')) {
    return;
  }
  $crawler = new Crawler(null, $uri);
  $crawler
    ->addContent($content, $type);
  return $crawler;
}