You are here

public function Traverser::__construct in Zircon Profile 8.0

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

Create a traverser.

Parameters

DOMNode|DOMNodeList $dom: The document or node to traverse.

resource $out: A stream that allows writing. The traverser will output into this stream.

array $options: An array or options for the traverser as key/value pairs. These include:

  • encode_entities: A bool to specify if full encding should happen for all named

charachter references. Defaults to false which escapes &'<>".

  • output_rules: The path to the class handling the output rules.

File

vendor/masterminds/html5/src/HTML5/Serializer/Traverser.php, line 49

Class

Traverser
Traverser for walking a DOM tree.

Namespace

Masterminds\HTML5\Serializer

Code

public function __construct($dom, $out, RulesInterface $rules, $options = array()) {
  $this->dom = $dom;
  $this->out = $out;
  $this->rules = $rules;
  $this->options = $options;
  $this->rules
    ->setTraverser($this);
}