Overview

Namespaces

  • Tokamak
    • Dom

Classes

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

Class Component

Class Component

Tokamak\Dom\Node
Extended by Tokamak\Dom\Component
Abstract
Namespace: Tokamak\Dom
Package: Tokamak\Dom
Todo:: add selectors to make it easy to access descendant nodes within a component.
Located at Dom/Component.php
Methods summary
public
# __construct( DOMDocument $dom, array $data = null )

Accepts array of data/state and builds the component's DOM structure via the implemented render method.

Accepts array of data/state and builds the component's DOM structure via the implemented render method.

Parameters

$dom
The ancestor DOMDocument instance.
$data
Array of arbitrarty data/state passed to the component.
public Tokamak\Dom\Node
# append( Tokamak\Dom\Node $child )

Since a Component can have multiple top-level elements, the semantics of "appending" are ambiguous. In this implementation, calling "append" on a component instance will append a node to the parent element as a sibling after this component.

Since a Component can have multiple top-level elements, the semantics of "appending" are ambiguous. In this implementation, calling "append" on a component instance will append a node to the parent element as a sibling after this component.

Parameters

$child

Returns

Tokamak\Dom\Node
public
# setParentNode( DOMNode $parent )

Set a parent DOMNode. Once this instance has already been appended by its parent, any subsequent chained method calls to append must be appended directly to the parent's underlying DOMNode.

Set a parent DOMNode. Once this instance has already been appended by its parent, any subsequent chained method calls to append must be appended directly to the parent's underlying DOMNode.

Parameters

$parent
Methods inherited from Tokamak\Dom\Node
addDomNode(), appendComponent(), appendElement(), getDom(), getDomNode(), hasDomNodes(), render(), setDom()
Properties summary
protected array $data

the data that is passed into the component

the data that is passed into the component

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