Attribute Class
An HTML attribute used on the Node, this is used internally.
Do not initiate this class directly, use the html()
function
to create attributes on elements.
echo html('a', 'Link', 'class=button href="about.html"');
echo html('a', 'Link')
->setAttribute('class', 'button')
->setAttribute('href', 'about.html');
Constructor
Item Index
Methods
__toString
()
String
Convert the attribute to an HTML tag attribute string
Returns:
String:
String representation of attribute
getValue
()
String
protected
Get the value of this attribute
Returns:
String:
The value of attribute
setName
(
-
[name=null]
Set the name of this attribute, cannot be empty
Parameters:
-
[name=null]
String optionalThe name of the attribute
setValue
(
protected
-
value
Set the value of this attribute, this cannot be empty
Parameters:
-
value
StringThe value to set
shorthand
(
Dictionary
static
-
str
Convert a string into an associative array
Parameters:
-
str
StringThe string, delineated by semicolons, and colons for attributes:values
Returns:
Dictionary:
The collection of attributes