HTML Tag Class

copyright CONTREXX CMS - COMVATION AG
author Reto Kohli
version 3.0.0
package contrexx
subpackage core

 Methods

Construct a Tag object

__construct(string $name, array $attributes) 

The attributes array, if specified, must be of the form array( attribute name => attribute value, ... more ... )

Parameters

$name

string

The tag name

$attributes

array

The optional list of attributes

Returns the string representation of the tag's attributes

getAttributeString() : string

If there are no attributes, the empty string is returned. Otherwise, a leading space is prepended to the string.

Returns

stringThe string representation of the tags' attributes

Returns the value for the given attribute name

getAttributeValue(string $name) : string

If the attribute with the given name is not present, the empty string is returned.

Parameters

$name

string

The attribute name

Returns

stringThe attribute value, or the empty string

Returns the attributes array

getAttributes() : array

Returns

arrayThe attribute array

Returns the name of the tag object

getName() : string

Returns

stringThe tag name

Sets the value of the given attribute

setAttribute(string $name, string $value) : void

If the value is empty, the attribute is removed.

Parameters

$name

string

The attribute name

$value

string

The attribute value

Returns the string representation of the tag

toString() : string

Returns

stringThe string representation of the tag

 Properties

 

$attributes : array
 

$first_child : mixed

May be empty, a HtmlTag object or a string

 

$name : string
 

$next_sibling : mixed

May be empty, a HtmlTag object or a string

© Copyright 2014 by Comvation AG
Generated on 2014-07-11T08:39:20+02:00.