create() public static method

Create new element.
public static create ( DOMNode | string $name, string $value = null, array $attributes = [] ) : Element
$name DOMNode | string The tag name of the element
$value string The value of the element
$attributes array The attributes of the element
return Element
Example #1
0
 public function testCreate()
 {
     $element = Element::create('span', 'Foo', ['class' => 'bar']);
     $this->assertEquals('span', $element->tag);
     $this->assertEquals('Foo', $element->text());
     $this->assertEquals(['class' => 'bar'], $element->attributes());
 }