setOptions() публичный Метод

Sets a new options param to override the current option array.
public setOptions ( array $options )
$options array
 /**
  * Parsers the html of the given string. Used for load(), loadFromFile(),
  * and loadFromUrl().
  *
  * @param string $str
  * @param array $option
  * @chainable
  */
 protected function loadStr($str, $option)
 {
     $this->options = new Options();
     $this->options->setOptions($this->globalOptions)->setOptions($option);
     $this->rawSize = strlen($str);
     $this->raw = $str;
     $html = $this->clean($str);
     $this->size = strlen($str);
     $this->content = new Content($html);
     $this->parse();
     $this->detectCharset();
     return $this;
 }
Пример #2
0
 public function testAddingOver()
 {
     $options = new Options();
     $options->setOptions(['test' => false])->setOptions(['test' => true, 'whitespaceTextNode' => false]);
     $this->assertFalse($options->get('whitespaceTextNode'));
 }