Class Html (namespace Nette\Web)
HTML helper.
- $el->class = 'myclass';
- echo $el;
Object | --Html
Implements interfaces:
| Method Summary | |
|---|---|
| Html |
Adds new element's child.
|
| string |
attributes
()
Returns element's attributes.
|
| int |
count
()
Required by the \Countable interface.
|
| Html |
create
(string $name, [array|string $attrs =
NULL])
Creates and adds a new Html child.
|
| static Html |
Static factory.
|
| string |
endTag
()
Returns element's end tag.
|
| void |
getChildren
()
Returns all of children.
|
| RecursiveIterator |
getIterator
([bool $deep =
FALSE], string 1)
Iterates over a elements.
|
| string |
getName
()
Returns element's name.
|
| string |
getText
()
Gets element's textual content.
|
| Html |
href
(string $path, [array $query =
NULL])
Special setter for element's attribute.
|
| Html |
Inserts child node.
|
| bool |
isEmpty
()
Is element empty?
|
| bool |
offsetExists
(int $index)
Exists child node? (\ArrayAccess implementation).
|
| mixed |
offsetGet
(int $index)
Returns child node (\ArrayAccess implementation).
|
| void |
Inserts (replaces) child node (\ArrayAccess implementation).
|
| void |
offsetUnset
(int $index)
Removes child node (\ArrayAccess implementation).
|
| void |
Removed all children.
|
| string |
render
([int $indent =
NULL])
Renders element's start tag, content and end tag.
|
| Html |
setHtml
(string $html)
Sets element's HTML content.
|
| Html |
setName
(string $name, [bool $isEmpty =
NULL])
Changes element's name.
|
| Html |
setText
(string $text, [$isHtml =
FALSE])
Sets element's textual content.
|
| string |
startTag
()
Returns element's start tag.
|
| Html |
__call
(string $m, array $args)
Overloaded setter for element's attribute.
|
| void |
__clone
()
Clones all children too.
|
| & mixed |
__get
(string $name)
Overloaded getter for element's attribute.
|
| void |
__set
(string $name, mixed $value)
Overloaded setter for element's attribute.
|
| void |
__toString
()
|
| void |
__unset
(string $name)
Overloaded unsetter for element's attribute.
|
| Variable Summary | ||||
|---|---|---|---|---|
| array | $attrs | array() |
line 53 element's attributes |
|
| protected array | $children | array() |
line 56 of Html | string nodes |
|
| static array | $emptyElements | array('img'=>1,'hr'=>1,'br'=>1,'input'=>1,'meta'=>1,'area'=>1,... |
line 62 empty elements |
|
| static bool | $xhtml | TRUE |
line 59 use XHTML syntax? |
|
| Method Details | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 282 addpublic Html add (Html|string $child) Adds new element's child.
|
||||||||||||||||||||||||
|
line 507 attributespublic string attributes () Returns element's attributes.
|
||||||||||||||||||||||||
|
line 385 countpublic int count () Required by the \Countable interface. Implementation of:
Countable::count
|
||||||||||||||||||||||||
|
line 295 createpublic Html create (string $name, [array|string $attrs = Creates and adds a new Html child.
|
||||||||||||||||||||||||
|
line 73 elpublic static Html el ([string $name = Static factory.
|
||||||||||||||||||||||||
|
line 496 endTagpublic string endTag () Returns element's end tag.
|
||||||||||||||||||||||||
|
line 426 getChildrenpublic void getChildren () Returns all of children. return array
|
||||||||||||||||||||||||
|
line 409 getIteratorpublic RecursiveIterator getIterator ([bool $deep = Iterates over a elements. Implementation of:
IteratorAggregate::getIterator
|
||||||||||||||||||||||||
|
line 118 getNamepublic string getName () Returns element's name.
|
||||||||||||||||||||||||
|
line 265 getTextpublic string getText () Gets element's textual content.
|
||||||||||||||||||||||||
|
line 205 hrefpublic Html href (string $path, [array $query = Special setter for element's attribute.
|
||||||||||||||||||||||||
|
line 311 insertpublic Html insert (int $index, Html $child, [bool $replace = Inserts child node.
|
||||||||||||||||||||||||
|
line 129 isEmptypublic bool isEmpty () Is element empty?
|
||||||||||||||||||||||||
|
line 360 offsetExistspublic bool offsetExists (int $index) Exists child node? (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetExists
|
||||||||||||||||||||||||
|
line 348 offsetGetpublic mixed offsetGet (int $index) Returns child node (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetGet
|
||||||||||||||||||||||||
|
line 336 offsetSetpublic void offsetSet (int $index, Html $child) Inserts (replaces) child node (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetSet
|
||||||||||||||||||||||||
|
line 372 offsetUnsetpublic void offsetUnset (int $index) Removes child node (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetUnset
|
||||||||||||||||||||||||
|
line 396 removeChildrenpublic void removeChildren () Removed all children.
|
||||||||||||||||||||||||
|
line 438 renderpublic string render ([int $indent = Renders element's start tag, content and end tag.
|
||||||||||||||||||||||||
|
line 223 setHtmlpublic Html setHtml (string $html) Sets element's HTML content.
|
||||||||||||||||||||||||
|
line 101 setNamepublic Html setName (string $name, [bool $isEmpty = Changes element's name.
|
||||||||||||||||||||||||
|
line 248 setTextpublic Html setText (string $text, [$isHtml = Sets element's textual content.
|
||||||||||||||||||||||||
|
line 480 startTagpublic string startTag () Returns element's start tag.
|
||||||||||||||||||||||||
|
line 179 __callpublic Html __call (string $m, array $args) Overloaded setter for element's attribute.
|
||||||||||||||||||||||||
|
line 559 __clonepublic void __clone () Clones all children too.
|
||||||||||||||||||||||||
|
line 154 __getpublic mixed & __get (string $name) Overloaded getter for element's attribute.
|
||||||||||||||||||||||||
|
line 142 __setpublic void __set (string $name, mixed $value) Overloaded setter for element's attribute.
|
||||||||||||||||||||||||
|
line 469 __toStringpublic void __toString ()
|
||||||||||||||||||||||||
|
line 166 __unsetpublic void __unset (string $name) Overloaded unsetter for element's attribute.
|
||||||||||||||||||||||||