Html
class Html
Class Html
Methods
Statically creates an html element string.
Statically create an attribute.
Html constructor.
No description
Add an array of classes to an element.
Add an attribute to an element.
Add an array of attributes to an element.
No description
Initialize the element's content body.
Instantiates a new element instance, pushes it on to the parent's array of children, and returns the newly created child instance.
Render the child elements (recursive).
Render the element object to an html string.
No description
Details
at line line 49
static string
createElement(string $tagName = 'div', string $content = '', null $attributes = NULL)
Statically creates an html element string.
at line line 75
static string
createAttribute($name, $value)
Statically create an attribute.
Just returns the attribute string.
at line line 95
static string
renderNode(Html $el)
Renders an instance of Html.
Used for recursively rendering instances with children.
at line line 106
__construct(string $tagName = 'div', string $content = '')
Html constructor.
at line line 119
Html
id($id)
Define the element's id attribute.
at line line 129
string|void
getId()
at line line 146
Html
addClass($className)
Add a single class to an element.
at line line 163
Html
addClasses(array $classList)
Add an array of classes to an element.
at line line 193
Html
addAttribute($name, $value)
Add an attribute to an element.
at line line 207
Html
addAttributes(array $attributeList)
Add an array of attributes to an element.
at line line 240
Html
addStyle($name, $value)
Add a style to an element.
at line line 254
Html
addStyles(array $styleList)
Add an array of styles to an element.
at line line 267
string|void
getStyles()
at line line 286
Html
append($newContent)
Append content to the elements content body.
at line line 300
Html
prepend($newContent)
Prepend content to the element's content body.
at line line 314
Html
setContent($newContent)
Initialize the element's content body.
at line line 331
Html
newChild(string $tagName = 'div', string $content = '')
Instantiates a new element instance, pushes it on to the parent's array of children, and returns the newly created child instance.
at line line 344
string
renderChildren()
Render the child elements (recursive).
at line line 354
string
render()
Render the element object to an html string.