Element Class

Create object

Create a object of the Html\Element class:

$element = new Html\Element();

Init

Init the class:

$element->init(string $tag, array $attributeArray) : self;

Copy

Copy the element:

$element->copy() : self;

Attribute

Set attribute to the element:

$element->attr(string|array $attribute, string $value) : self;

Remove attribute from the element:

$element->removeAttr(string $attribute) : self;

Class

Add class to the element:

$element->addClass(string $className) : self;

Remove class from the element:

$element->removeClass(string $className) : self;

Val

Set value to the element:

$element->val(string $value) : self;

Text

Set text to the element:

$element->text(string $text) : self;

Html

Set HTML to the element:

$element->html(string $html) : self;

Append

Append HTML to the element:

$element->append(string $html) : self;

Prepend

Prepend HTML to the element:

$element->prepend(string $html) : self;

Clear

Clear HTML of the element:

$element->clear() : self;

Render

Render the element:

$element->render() : string;
Edit on GitHub