Methods summary
public static
Nette\Utils\Html
|
#
el( string $name = NULL, array|string $attrs = NULL )
Static factory.
Parameters
- $name
- name (or NULL)
- $attrs
- attributes or plain text content
Returns
|
public
Nette\Utils\Html
|
#
setName( string $name, boolean $isEmpty = NULL )
Changes element's name.
Parameters
- $name
- $isEmpty
- element empty?
Returns
Throws
|
public
string
|
#
getName( )
Returns element's name.
Returns
string string
|
public
boolean
|
#
isEmpty( )
Is element empty?
Returns
boolean bool
|
public
Nette\Utils\Html
|
#
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
- attribute name
- $value
- attribute value
Throws
MemberAccessException if the property is not defined or is read-only
Overrides
|
public
mixed
&
|
#
__get( string $name )
Overloaded getter for element's attribute.
Overloaded getter for element's attribute.
Parameters
Returns
mixed HTML attribute value
Throws
MemberAccessException if the property is not defined.
Overrides
|
public
boolean
|
#
__isset( string $name )
Overloaded tester for element's attribute.
Overloaded tester for element's attribute.
Parameters
Returns
boolean bool
Overrides
|
public
|
#
__unset( string $name )
Overloaded unsetter for element's attribute.
Overloaded unsetter for element's attribute.
Parameters
Throws
MemberAccessException MemberAccessException
Overrides
|
public
Nette\Utils\Html
|
#
__call( string $m, array $args )
Overloaded setter for element's attribute.
Overloaded setter for element's attribute.
Parameters
- $m
- attribute name
- $args
- HTML attribute value or pair?
Returns
Throws
MemberAccessException MemberAccessException
Overrides
|
public
Nette\Utils\Html
|
#
href( string $path, array $query = NULL )
Special setter for element's attribute.
Special setter for element's attribute.
Parameters
Returns
|
public
Nette\Utils\Html
|
#
data( $name, $value = NULL )
Setter for data-* attributes. Booleans are converted to 'true' resp.
'false'.
Setter for data-* attributes. Booleans are converted to 'true' resp.
'false'.
Returns
|
public
Nette\Utils\Html
|
#
setHtml( string $html )
Sets element's HTML content.
Sets element's HTML content.
Parameters
Returns
Throws
|
public
string
|
#
getHtml( )
Returns element's HTML content.
Returns element's HTML content.
Returns
string string
|
public
Nette\Utils\Html
|
#
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 string
|
public
Nette\Utils\Html
|
#
add( Nette\Utils\Html |string $child )
Adds new element's child.
Adds new element's child.
Parameters
- $child
- node or raw HTML string
Returns
|
public
Nette\Utils\Html
|
#
addHtml( Nette\Utils\Html |string $child )
Adds new element's child.
Adds new element's child.
Parameters
- $child
- node or raw HTML string
Returns
|
public
Nette\Utils\Html
|
#
addText( string $text )
Appends plain-text string to element content.
Appends plain-text string to element content.
Parameters
Returns
|
public
Nette\Utils\Html
|
#
create( string $name, array|string $attrs = NULL )
Creates and adds a new Html child.
Creates and adds a new Html child.
Parameters
- $name
- name
- $attrs
- attributes or raw HTML string
Returns
|
public
Nette\Utils\Html
|
#
insert( integer|null $index, Nette\Utils\Html |string $child, boolean $replace = FALSE )
Inserts child node.
Parameters
- $index
- or NULL for appending
- $child
- node or raw HTML string
- $replace
Returns
Throws
|
public
|
#
offsetSet( integer|null $index, Nette\Utils\Html |string $child )
Inserts (replaces) child node (\ArrayAccess implementation).
Inserts (replaces) child node (\ArrayAccess implementation).
Parameters
- $index
- or NULL for appending
- $child
- node or raw HTML string
Implementation of
|
public
Nette\Utils\Html |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 bool
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 int
Implementation of
|
public
|
|
public
ArrayIterator
|
#
getIterator( )
Iterates over elements.
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 string
|
public
string
|
#
__toString( )
Returns
string in HTML format
Implementation of
|
public
string
|
#
startTag( )
Returns element's start tag.
Returns element's start tag.
Returns
string string
|
public
string
|
#
endTag( )
Returns element's end tag.
Returns element's end tag.
Returns
string string
|
public
|
|
Properties summary
public
array
|
$attrs
|
|
protected
array
|
$children
|
|
public static
boolean
|
$xhtml
|
|
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,
) |