PHP Class Habari\HTMLNode

Show file Open project: habari/system

Public Properties

Property Type Description
$node DomNode

Public Methods

Method Description
__construct ( DOMNode $node ) Constructor for this node
__get ( string $name ) : mixed Get the value of an attribute of this node
__set ( string $name, mixed $value ) Set the value of an attribute on this node
add_class ( string | array $newclass ) Add a class to the class attribute of this node
append_html ( string $html ) Append HTML as a child of this node
get ( ) : string Get this node's string representation
inner_html ( ) : string Get the HTML of all child elements of this node
promote_children ( ) Move the children of this node into this node's parent, just before this node in the DOM tree
remove ( ) Remove this node from the DOM
remove_class ( string | array $removeclass ) Remove a class from this node

Method Details

__construct() public method

Constructor for this node
public __construct ( DOMNode $node )
$node DOMNode The actual node we're trying to access

__get() public method

Get the value of an attribute of this node
public __get ( string $name ) : mixed
$name string The name of the attribute value to obtain
return mixed The value of the attribute

__set() public method

Set the value of an attribute on this node
public __set ( string $name, mixed $value )
$name string The name of the attribute to set
$value mixed The value of the parameter

add_class() public method

Add a class to the class attribute of this node
public add_class ( string | array $newclass )
$newclass string | array The class or classes to add to this node

append_html() public method

Append HTML as a child of this node
public append_html ( string $html )
$html string The HTML to add, which is subsequently parsed into DOMNodes

get() public method

Get this node's string representation
public get ( ) : string
return string The node's string representation

inner_html() public method

Get the HTML of all child elements of this node
public inner_html ( ) : string
return string The requested HTML

promote_children() public method

Move the children of this node into this node's parent, just before this node in the DOM tree
public promote_children ( )

remove() public method

Remove this node from the DOM
public remove ( )

remove_class() public method

Remove a class from this node
public remove_class ( string | array $removeclass )
$removeclass string | array The class or classes to remove from this node

Property Details

$node public property

public DomNode $node
return DomNode