You are here

public function HTML5::parse in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/masterminds/html5/src/HTML5.php \Masterminds\HTML5::parse()

Parse an input stream.

Lower-level loading function. This requires an input stream instead of a string, file, or resource.

2 calls to HTML5::parse()
HTML5::load in vendor/masterminds/html5/src/HTML5.php
Load and parse an HTML file.
HTML5::loadHTML in vendor/masterminds/html5/src/HTML5.php
Parse a HTML Document from a string.

File

vendor/masterminds/html5/src/HTML5.php, line 166

Class

HTML5
This class offers convenience methods for parsing and serializing HTML5. It is roughly designed to mirror the \DOMDocument class that is provided with most versions of PHP.

Namespace

Masterminds

Code

public function parse(\Masterminds\HTML5\Parser\InputStream $input, array $options = array()) {
  $this->errors = array();
  $events = new DOMTreeBuilder(false, array_merge($this
    ->getOptions(), $options));
  $scanner = new Scanner($input);
  $parser = new Tokenizer($scanner, $events);
  $parser
    ->parse();
  $this->errors = $events
    ->getErrors();
  return $events
    ->document();
}