![]() |
|
Html tag. More...
Public Member Functions | |
Tag ($type, $attributes=array()) | |
getType () | |
getAttribute ($name) | |
getAttributes () | |
hasAttribute ($name) | |
setAttribute ($attribute, $value= '') | |
append ($content=array()) | |
appendTo (Tag $tag) | |
getChildren () | |
html ($indent=-1) | |
indent ($indent=-1) | |
__toString () | |
Static Public Member Functions | |
static | newInstance ($type, $attributes=array()) |
Data Fields | |
$type | |
$attributes = array() | |
$content = array() | |
Html tag.
Tag | ( | $type, | |
$attributes = array() |
|||
) |
Constructor
string | $type | : type of the tag |
array | $attributes | : [optional] attributes for the tag |
|
static |
Static constructor to support chaining
string | $type | |
array | $attributes |
getType | ( | ) |
Get channel type
getAttribute | ( | $name | ) |
Get the value of an attribute for this Tag
string | $name | : name of the attribute |
getAttributes | ( | ) |
Get all attributes
hasAttribute | ( | $name | ) |
Check if an attribute exists for this tag
string | $name | : name of the attribute |
setAttribute | ( | $attribute, | |
$value = '' |
|||
) |
Set an attribute or add a set of attributes
array | $attribute | : attributes to set as a hashmap |
string | $attribute | : name of the attribute |
string | $value | : [optional] the value for a single attribute |
append | ( | $content = array() | ) |
appendTo | ( | Tag | $tag | ) |
getChildren | ( | ) |
Get the current tags children
html | ( | $indent = -1 | ) |
Get the html content for this tag
integer | $indent | : [optional] in case you need to use indentation, set this to 0, or to the number of tabs you want to start indenting at |
indent | ( | $indent = -1 | ) |
Get this object and it's html string representation
int | $indent | : [optional] in case you need to use indentation, set this to 0, or to the number of tabs you want to start indenting at |
__toString | ( | ) |
Tostring method
$type |
string : Tag type
$attributes = array() |
array : Tag Attributes
$content = array() |
array : Tag content