Class Node
HTML tag node.
A node can have an arbitrary number of child nodes. Child nodes are either other nodes, plain text or values that are converted to strings when the node is rendered as HTML.
- Core\Object implements Core\Chainable
- Core\Set implements Core\Accessor
- Core\Set\Mutable implements Core\Mutator
- Core\View\Driver\htmlbuilder\Node
Direct known subclasses
Core\View\Driver\htmlbuilder\Tags\COL
,
Core\View\Driver\htmlbuilder\Tags\COLGROUP
,
Core\View\Driver\htmlbuilder\Tags\SELECT
,
Core\View\Driver\htmlbuilder\Tags\TABLE
,
Core\View\Driver\htmlbuilder\Tags\TD
,
Core\View\Driver\htmlbuilder\Tags\TR
,
Core\View\Driver\htmlbuilder\Tags\UL
,
Core\View\Driver\htmlbuilder\Text
,
Core\View\Driver\htmlbuilder\Tags\FIELDSET
,
Core\View\Driver\htmlbuilder\Tags\FORM
,
Core\View\Driver\htmlbuilder\Tags\IMG
,
Core\View\Driver\htmlbuilder\Tags\INPUT
,
Core\View\Driver\htmlbuilder\Tags\LABEL
,
Core\View\Driver\htmlbuilder\Tags\OL
,
Core\View\Driver\htmlbuilder\Tags\OPTGROUP
,
Core\View\Driver\htmlbuilder\Tags\SCRIPT
Indirect known subclasses
Core\View\Driver\htmlbuilder\Tags\A
,
Core\View\Driver\htmlbuilder\Tags\DIV
,
Core\View\Driver\htmlbuilder\Tags\LEGEND
,
Core\View\Driver\htmlbuilder\Tags\LI
,
Core\View\Driver\htmlbuilder\Tags\P
,
Core\View\Driver\htmlbuilder\Tags\TBODY
,
Core\View\Driver\htmlbuilder\Tags\TEXTAREA
,
Core\View\Driver\htmlbuilder\Tags\TFOOT
,
Core\View\Driver\htmlbuilder\Tags\TH
,
Core\View\Driver\htmlbuilder\Tags\THEAD
Package: Core\View\HTMLBuilder
Since: 3.0
Requires: PHP 5.3
Version: 1.0
Located at View/Driver/htmlbuilder/Node.inc.php
Methods summary
public
|
|
protected
|
#
__construct(
Node constructor. |
public
string
|
|
protected static
array
|
|
public
|
|
public
|
#
append(
Appends a new node to the list of child nodes. |
public
|
|
public static
static
|
|
public
|
#
extend(
Appends a new child node but returns an instance to this node instead. |
public
string
|
#
id( )
Returns the unique ID for the node. If no ID has been assigned when the node was created, an ID is automatically assigned to the node. Such an ID is generated. IDs are reset if a node is cloned. |
public
boolean
|
|
public
|
#
js( string $code )
Inserts a JavaScript block (surrounded by a script tag) to the list of child nodes. |
public
|
#
jsCDATA( string $code )
Adds a new |
public
string
|
#
safeID( )
Returns the node ID encoded for use with HTML node attributes. The characters »[« and »]« are replaced by minus signs, an auto-index ID is appended by the element's UUID. |
protected
|
#
setAllowsShortTag( )
Leftover method from early development phase. Raises an exception to detect code pieces that still rely on the existence of the KVC value. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
Methods inherited from Core\Set\Mutable
Methods inherited from Core\Object
__autocreateFactory()
,
__call()
,
__processParameters()
,
attachMethod()
,
chain()
,
getValueForKey()
,
getValueForKeyPath()
,
getValueForUndefinedKey()
,
hash()
,
issetValueForKey()
,
setValueForKey()
,
setValueForKeyPath()
,
setValueForUndefinedKey()
,
uuid()
Constants summary
boolean |
AllowsInnerNL
If set, the rendering of the HTML tag represented by the node is not affected by newlines inside the tag. |
#
false
|
boolean |
AllowsOuterNL
If set, the rendering of the HTML tag represented by the node is not affected by newlines outside the tag. |
#
false
|
boolean |
AllowsShortTag
If set, the HTML tag represented by the node allows short tag notion. |
#
true
|
Constants inherited from Core\Object
AnyParameterType
,
AutochainParameterType
,
AutocreateParameterType
,
BooleanParameterType
,
CharParameterType
,
EnumParameterType
,
IntegerParameterType
,
RealParameterType
,
StringParameterType
,
UserParameterType
Properties summary
protected
|
$_v_attributes
Associative array of node attributes. The actual class used is defined via the attribute class attribute. |
|
protected
string
|
$_v_attributeClass
Name of class to use for storing attributes. Should be compatible to an array object that allows getting/setting entries using array syntax. |
#
'\ArrayObject'
|
protected
mixed[]
|
$_v_children
Array of child nodes. |
|
protected
|
$_v_classes
Array of assigned CSS classes. |
|
protected
|
$_v_proxy
HTML Builder proxy driver instance. |
|
protected
array
|
$_v_styles
Associative array of inline styles. |
|
protected
string
|
$_v_type
HTML tag name. |
|
protected
string
|
$_id
Assigned ID of element, automatically generated by the |
|
protected
string
|
$_safeID
Calculated safe ID for use as a HTML attribute. |
Magic properties
public read-only
|
$attributes
Associative array of node attributes. |
public read-only
string
|
$attributeClass
Name of class used for attributes. |
public read-only
|
$classes
Array of assigned CSS classes. |
public read-only
string
|
$id
Unique node ID. |
public read-only
|
$proxy
HTML Builder proxy driver instance. |
public read-only
string
|
$safeID
Unique node ID encoded for use within HTML node attributes. |
public read-only
array
|
$styles
Associative array of inline styles. |
public read-only
string
|
$type
HTML tag name. |