PHPHtmlParser\Dom\Tag::setAttributes PHP Method

setAttributes() public method

Sets the attributes for this tag
public setAttributes ( array $attr )
$attr array
    public function setAttributes(array $attr)
    {
        foreach ($attr as $key => $value) {
            $this->setAttribute($key, $value);
        }
        return $this;
    }

Usage Example

Example #1
0
 public function testOuterHtmlEmpty()
 {
     $a = new Tag('a');
     $a->setAttributes(['href' => ['value' => 'http://google.com', 'doubleQuote' => false]]);
     $node = new HtmlNode($a);
     $this->assertEquals("<a href='http://google.com'></a>", $node->OuterHtml());
 }
All Usage Examples Of PHPHtmlParser\Dom\Tag::setAttributes