Class Html (namespace Nette\Web)
HTML helper.
Object | --Html
Implements interfaces:
Public 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.
|
Methods Inherited From Object |
---|
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset() |
Variable Summary | ||||
---|---|---|---|---|
array | $attrs | array() |
line 51 element's attributes |
|
protected array | $children | array() |
line 54 of Html | string nodes |
|
static array | $emptyElements | array('img'=>1,'hr'=>1,'br'=>1,'input'=>1,'meta'=>1,'area'=>1,... |
line 60 empty elements |
|
static bool | $xhtml | TRUE |
line 57 use XHTML syntax? |
Method Details | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 280 addpublic Html add (Html|string $child) Adds new element's child.
|
||||||||||||||||||||||||
line 505 attributespublic string attributes () Returns element's attributes.
|
||||||||||||||||||||||||
line 383 countpublic int count () Required by the \Countable interface. Implementation of:
Countable::count
|
||||||||||||||||||||||||
line 293 createpublic Html create (string $name, [array|string $attrs = Creates and adds a new Html child.
|
||||||||||||||||||||||||
line 71 elpublic static Html el ([string $name = Static factory.
|
||||||||||||||||||||||||
line 494 endTagpublic string endTag () Returns element's end tag.
|
||||||||||||||||||||||||
line 424 getChildrenpublic void getChildren () Returns all of children. return array
|
||||||||||||||||||||||||
line 407 getIteratorpublic RecursiveIterator getIterator ([bool $deep = Iterates over a elements. Implementation of:
IteratorAggregate::getIterator
|
||||||||||||||||||||||||
line 116 getNamepublic string getName () Returns element's name.
|
||||||||||||||||||||||||
line 263 getTextpublic string getText () Gets element's textual content.
|
||||||||||||||||||||||||
line 203 hrefpublic Html href (string $path, [array $query = Special setter for element's attribute.
|
||||||||||||||||||||||||
line 309 insertpublic Html insert (int $index, Html $child, [bool $replace = Inserts child node.
|
||||||||||||||||||||||||
line 127 isEmptypublic bool isEmpty () Is element empty?
|
||||||||||||||||||||||||
line 358 offsetExistspublic bool offsetExists (int $index) Exists child node? (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetExists
|
||||||||||||||||||||||||
line 346 offsetGetpublic mixed offsetGet (int $index) Returns child node (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetGet
|
||||||||||||||||||||||||
line 334 offsetSetpublic void offsetSet (int $index, Html $child) Inserts (replaces) child node (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetSet
|
||||||||||||||||||||||||
line 370 offsetUnsetpublic void offsetUnset (int $index) Removes child node (\ArrayAccess implementation). Implementation of:
ArrayAccess::offsetUnset
|
||||||||||||||||||||||||
line 394 removeChildrenpublic void removeChildren () Removed all children.
|
||||||||||||||||||||||||
line 436 renderpublic string render ([int $indent = Renders element's start tag, content and end tag.
|
||||||||||||||||||||||||
line 221 setHtmlpublic Html setHtml (string $html) Sets element's HTML content.
|
||||||||||||||||||||||||
line 99 setNamepublic Html setName (string $name, [bool $isEmpty = Changes element's name.
|
||||||||||||||||||||||||
line 246 setTextpublic Html setText (string $text, [$isHtml = Sets element's textual content.
|
||||||||||||||||||||||||
line 478 startTagpublic string startTag () Returns element's start tag.
|
||||||||||||||||||||||||
line 177 __callpublic Html __call (string $m, array $args) Overloaded setter for element's attribute.
|
||||||||||||||||||||||||
line 557 __clonepublic void __clone () Clones all children too.
|
||||||||||||||||||||||||
line 152 __getpublic mixed & __get (string $name) Overloaded getter for element's attribute.
|
||||||||||||||||||||||||
line 140 __setpublic void __set (string $name, mixed $value) Overloaded setter for element's attribute.
|
||||||||||||||||||||||||
line 467 __toStringpublic void __toString ()
|
||||||||||||||||||||||||
line 164 __unsetpublic void __unset (string $name) Overloaded unsetter for element's attribute.
|