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 82
static TexyHtml
el($name = NULL, $attrs = NULL)
Static factory.
at line 102
final TexyHtml
setName($name, $empty = NULL)
Changes element's name.
at line 118
final string
getName()
Returns element's name.
at line 128
final bool
isEmpty()
Is element empty?
at line 140
final void
__set($name, $value)
Overloaded setter for element's attribute.
at line 151
final mixed
__get($name)
Overloaded getter for element's attribute.
at line 181
final TexyHtml
href($path, $query = NULL)
Special setter for element's attribute.
at line 199
final TexyHtml
setText($text)
Sets element's textual content.
at line 215
final string
getText()
Gets element's textual content.
at line 233
final TexyHtml
add($child)
Adds new element's child.
at line 245
final TexyHtml
create($name, $attrs = NULL)
Creates and adds a new TexyHtml child.
at line 260
TexyHtml
insert($index, $child, $replace = FALSE)
Inserts child node.
at line 284
final void
offsetSet($index, $child)
Inserts (replaces) child node (ArrayAccess implementation).
at line 295
final mixed
offsetGet($index)
Returns child node (ArrayAccess implementation).
at line 306
final bool
offsetExists($index)
Exists child node? (ArrayAccess implementation).
at line 317
void
offsetUnset($index)
Removes child node (ArrayAccess implementation).
at line 329
final int
count()
Required by the Countable interface.
at line 339
void
removeChildren()
Removed all children.
at line 349
final ArrayIterator
getIterator()
Required by the IteratorAggregate interface.
at line 359
final
getChildren()
Returns all of children.
return array
at line 370
final string
toString(Texy $texy)
Renders element's start tag, content and end tag to internal string representation.
at line 399
final string
toHtml(Texy $texy)
Renders to final HTML.
at line 410
final string
toText(Texy $texy)
Renders to final text.
at line 420
string
startTag()
Returns element's start tag.
at line 487
string
endTag()
Returns element's end tag.
at line 499
__clone()
Clones all children too.
at line 512
final int
getContentType()
No description
at line 526
final void
validateAttrs($dtd)
No description
at line 541
validateChild($child, $dtd)
No description
at line 560
final void
parseLine(Texy $texy, $s)
Parses text as single line.
at line 579
final void
parseBlock(Texy $texy, $s, $indented = FALSE)
Parses text as block.