TexyHtml
class TexyHtml extends TexyObject implements ArrayAccess, IteratorAggregate
HTML helper.
usage: $anchor = TexyHtml::el('a')->href($link)->setText('Texy'); $el->class = 'myclass';
echo $el->startTag(), $el->endTag();
Properties
array | $attrs | ||
protected array | $children | ||
static bool | $xhtml | ||
static array | $emptyElements | ||
static array | $inlineElements | ||
static array | $optionalEnds | ||
static | $prohibits |
Methods
Returns element's name.
Is element empty?
Overloaded setter for element's attribute.
Overloaded getter for element's attribute.
Gets element's textual content.
Inserts (replaces) child node (ArrayAccess implementation).
Returns child node (ArrayAccess implementation).
Exists child node? (ArrayAccess implementation).
Removes child node (ArrayAccess implementation).
Required by the Countable interface.
Removed all children.
Required by the IteratorAggregate interface.
Returns all of children.
Returns element's start tag.
Returns element's end tag.
Clones all children too.
No description
No description
No description
Details
at line 81
static TexyHtml
el($name = NULL, $attrs = NULL)
Static factory.
at line 101
final TexyHtml
setName($name, $empty = NULL)
Changes element's name.
at line 117
final string
getName()
Returns element's name.
at line 127
final bool
isEmpty()
Is element empty?
at line 139
final void
__set($name, $value)
Overloaded setter for element's attribute.
at line 150
final mixed
__get($name)
Overloaded getter for element's attribute.
at line 180
final TexyHtml
href($path, $query = NULL)
Special setter for element's attribute.
at line 198
final TexyHtml
setText($text)
Sets element's textual content.
at line 214
final string
getText()
Gets element's textual content.
at line 232
final TexyHtml
add($child)
Adds new element's child.
at line 244
final TexyHtml
create($name, $attrs = NULL)
Creates and adds a new TexyHtml child.
at line 259
TexyHtml
insert($index, $child, $replace = FALSE)
Inserts child node.
at line 283
final void
offsetSet($index, $child)
Inserts (replaces) child node (ArrayAccess implementation).
at line 294
final mixed
offsetGet($index)
Returns child node (ArrayAccess implementation).
at line 305
final bool
offsetExists($index)
Exists child node? (ArrayAccess implementation).
at line 316
void
offsetUnset($index)
Removes child node (ArrayAccess implementation).
at line 328
final int
count()
Required by the Countable interface.
at line 338
void
removeChildren()
Removed all children.
at line 348
final ArrayIterator
getIterator()
Required by the IteratorAggregate interface.
at line 358
final
getChildren()
Returns all of children.
return array
at line 369
final string
toString(Texy $texy)
Renders element's start tag, content and end tag to internal string representation.
at line 398
final string
toHtml(Texy $texy)
Renders to final HTML.
at line 409
final string
toText(Texy $texy)
Renders to final text.
at line 419
string
startTag()
Returns element's start tag.
at line 486
string
endTag()
Returns element's end tag.
at line 498
__clone()
Clones all children too.
at line 511
final int
getContentType()
No description
at line 525
final void
validateAttrs($dtd)
No description
at line 540
validateChild($child, $dtd)
No description
at line 559
final void
parseLine(Texy $texy, $s)
Parses text as single line.
at line 578
final void
parseBlock(Texy $texy, $s, $indented = FALSE)
Parses text as block.