setAttribute() public method

Set an attribute on an element
public setAttribute ( string $name, string $value ) : DOMAttr
$name string
$value string
return DOMAttr
コード例 #1
0
ファイル: Rayfish.php プロジェクト: fluentdom/fluentdom
 /**
  * Transfer attributes to the node.
  *
  * @param Element $node
  * @param \stdClass $namespaces
  * @param \stdClass $attributes
  */
 private function transferAttributes(Element $node, $namespaces, $attributes)
 {
     foreach ($namespaces as $name => $value) {
         $node->setAttribute($name, $value);
     }
     foreach ($attributes as $name => $value) {
         $node->setAttribute($name, $value);
     }
 }