Methods summary
public static
NHtml
|
#
el( string $name = NULL, array|string $attrs = NULL )
Static factory.
Parameters
- $name
string element name (or NULL)
- $attrs
array|string element's attributes or plain text content
Returns
|
public
NHtml
|
#
setName( string $name, boolean $isEmpty = NULL )
Changes element's name.
Parameters
- $name
string
- $isEmpty
boolean Is element empty?
Returns
Throws
|
public
string
|
#
getName( )
Returns element's name.
Returns
string
|
public
boolean
|
#
isEmpty( )
Is element empty?
Returns
boolean
|
public
NHtml
|
#
addAttributes( array $attrs )
Sets multiple attributes.
Sets multiple attributes.
Parameters
Returns
|
public
|
#
__set( string $name, mixed $value )
Overloaded setter for element's attribute.
Overloaded setter for element's attribute.
Parameters
- $name
string HTML attribute name
- $value
mixed HTML attribute value
Throws
Overrides
|
public
mixed
&
|
#
__get( string $name )
Overloaded getter for element's attribute.
Overloaded getter for element's attribute.
Parameters
- $name
string HTML attribute name
Returns
mixed HTML attribute value
Throws
Overrides
|
public
boolean
|
#
__isset( string $name )
Overloaded tester for element's attribute.
Overloaded tester for element's attribute.
Parameters
- $name
string HTML attribute name
Returns
boolean
Overrides
|
public
|
#
__unset( string $name )
Overloaded unsetter for element's attribute.
Overloaded unsetter for element's attribute.
Parameters
- $name
string HTML attribute name
Throws
Overrides
|
public
NHtml
|
#
__call( string $m, array $args )
Overloaded setter for element's attribute.
Overloaded setter for element's attribute.
Parameters
- $m
string HTML attribute name
- $args
array (string) HTML attribute value or pair?
Returns
Throws
Overrides
|
public
NHtml
|
#
href( string $path, array $query = NULL )
Special setter for element's attribute.
Special setter for element's attribute.
Parameters
- $path
string path
- $query
array query
Returns
|
public
NHtml
|
#
setHtml( string $html )
Sets element's HTML content.
Sets element's HTML content.
Parameters
- $html
string raw HTML string
Returns
Throws
|
public
string
|
#
getHtml( )
Returns element's HTML content.
Returns element's HTML content.
Returns
string
|
public
NHtml
|
#
setText( string $text )
Sets element's textual content.
Sets element's textual content.
Parameters
Returns
Throws
|
public
string
|
#
getText( )
Returns element's textual content.
Returns element's textual content.
Returns
string
|
public
NHtml
|
#
add( NHtml |string $child )
Adds new element's child.
Adds new element's child.
Parameters
- $child
NHtml |string
Html node or raw HTML string
Returns
|
public
NHtml
|
#
create( string $name, array|string $attrs = NULL )
Creates and adds a new Html child.
Creates and adds a new Html child.
Parameters
- $name
string elements's name
- $attrs
array|string element's attributes or raw HTML string
Returns
|
public
NHtml
|
#
insert( integer|null $index, NHtml |string $child, boolean $replace = FALSE )
Inserts child node.
Parameters
- $index
integer|null position of NULL for appending
- $child
NHtml |string
Html node or raw HTML string
- $replace
boolean
Returns
Throws
|
public
|
#
offsetSet( integer|null $index, NHtml |string $child )
Inserts (replaces) child node (ArrayAccess implementation).
Inserts (replaces) child node (ArrayAccess implementation).
Parameters
- $index
integer|null position of NULL for appending
- $child
NHtml |string
Html node or raw HTML string
Implementation of
|
public
NHtml |string
|
#
offsetGet( integer $index )
Returns child node (ArrayAccess implementation).
Returns child node (ArrayAccess implementation).
Parameters
Returns
Implementation of
|
public
boolean
|
#
offsetExists( integer $index )
Exists child node? (ArrayAccess implementation).
Exists child node? (ArrayAccess implementation).
Parameters
Returns
boolean
Implementation of
|
public
|
#
offsetUnset( integer $index )
Removes child node (ArrayAccess implementation).
Removes child node (ArrayAccess implementation).
Parameters
Implementation of
|
public
integer
|
#
count( )
Returns children count.
Returns
integer
Implementation of
|
public
|
|
public
RecursiveIterator
|
#
getIterator( boolean $deep = FALSE )
Iterates over a elements.
Iterates over a elements.
Parameters
Returns
Implementation of
|
public
array
|
|
public
string
|
#
render( integer $indent = NULL )
Renders element's start tag, content and end tag.
Renders element's start tag, content and end tag.
Parameters
Returns
string
|
public
|
|
public
string
|
#
startTag( )
Returns element's start tag.
Returns element's start tag.
Returns
string
|
public
string
|
#
endTag( )
Returns element's end tag.
Returns element's end tag.
Returns
string
|
public
|
|
Properties summary
public
array
|
$attrs
|
array() |
|
protected
array
|
$children
|
array() |
|
public static
boolean
|
$xhtml
|
TRUE |
|
public static
array
|
$emptyElements
|
array('img'=>1,'hr'=>1,'br'=>1,'input'=>1,'meta'=>1,'area'=>1,'embed'=>1,'keygen'=>1,
'source'=>1,'base'=>1,'col'=>1,'link'=>1,'param'=>1,'basefont'=>1,'frame'=>1,'isindex'=>1,'wbr'=>1,'command'=>1,'track'=>1) |
|