Overview

Namespaces

  • Tokamak
    • Dom

Classes

  • Component
  • Document
  • Element
  • HTMLDocument
  • Node
  • Overview
  • Namespace
  • Class

Class Element

Class Element

Tokamak\Dom\Node
Extended by Tokamak\Dom\Element
Namespace: Tokamak\Dom
Package: Tokamak\Dom
Located at Dom/Element.php
Methods summary
public
# __construct( DOMDocument $dom, string $name, array $attributes = null, string $content = '' )

Construct a DOM element and add it to the "domNodes" queue to be appended to the parent

Construct a DOM element and add it to the "domNodes" queue to be appended to the parent

Parameters

$dom
The underlying DOMDocument
$name
The element name ('div', 'a', 'body', etc.)
$attributes

Associative array of the element's attributes and their values. For "class", the value can also be an array of class names.

$content
The text content of the element.
protected
# render( )

Builds the \DOMElement instance and adds it to the domNodes queue

Builds the \DOMElement instance and adds it to the domNodes queue

public Tokamak\Dom\Node
# append( Tokamak\Dom\Node $child )

Append another node (element or component) to this element. Returns the child element for method chaining.

Append another node (element or component) to this element. Returns the child element for method chaining.

Parameters

$child

Returns

Tokamak\Dom\Node
The child element, returned for method chaining.
Methods inherited from Tokamak\Dom\Node
addDomNode(), appendComponent(), appendElement(), getDom(), getDomNode(), hasDomNodes(), setDom()
Properties summary
protected string $name

The element name ('div', 'a', 'body', etc.)

The element name ('div', 'a', 'body', etc.)

#
protected array $attributes

Associative array of the element's attributes and their values. For "class", the value can also be an array of class names.

Associative array of the element's attributes and their values. For "class", the value can also be an array of class names.

#
protected string $content

The text content of the element.

The text content of the element.

#
protected DOMElement $node

The underlying DOMElement object

The underlying DOMElement object

#
Properties inherited from Tokamak\Dom\Node
$COMPONENT_NAMESPACE, $dom, $domNodes
API documentation generated by ApiGen