TListItem class.
TListItem represents an item in a list control. Each item has a Text property and a Value property. If either one of them is not set, it will take the value of the other property. An item can be Selected or Enabled, and it can have additional Attributes which may be rendered if the list control supports so.
| Method Details |
getAttribute
| public string getAttribute |
(mixed $name ) |
| Input |
| mixed | $name | |
| Output |
|
string
| the named attribute value, null if attribute does not exist |
| Exception |
|
getAttributes
|
getEnabled
| public boolean getEnabled |
() |
| Output |
|
boolean
| whether the item is enabled |
| Exception |
|
getHasAttributes
| public boolean getHasAttributes |
() |
| Output |
|
boolean
| whether the item has any custom attribute |
| Exception |
|
getSelected
| public boolean getSelected |
() |
| Output |
|
boolean
| whether the item is selected |
| Exception |
|
getText
| Output |
|
string
| text of the item |
| Exception |
|
getValue
| public string getValue |
() |
| Output |
|
string
| value of the item |
| Exception |
|
hasAttribute
| public boolean hasAttribute |
(string $name ) |
| Input |
| string | $name | name of the attribute |
| Output |
|
boolean
| whether the named attribute exists |
| Exception |
|
removeAttribute
| public string removeAttribute |
(string $name ) |
Removes the named attribute.
| Input |
| string | $name | the name of the attribute to be removed. |
| Output |
|
string
| attribute value removed, empty string if attribute does not exist. |
| Exception |
|
setAttribute
| public void setAttribute |
(string $name , string $value ) |
| Input |
| string | $name | attribute name |
| string | $value | value of the attribute |
| Output |
| Exception |
|
setEnabled
| public void setEnabled |
(boolean $value ) |
| Input |
| boolean | $value | whether the item is enabled |
| Output |
| Exception |
|
setSelected
| public void setSelected |
(boolean $value ) |
| Input |
| boolean | $value | whether the item is selected |
| Output |
| Exception |
|
setText
| public void setText |
(string $value ) |
| Input |
| string | $value | text of the item |
| Output |
| Exception |
|
setValue
| public void setValue |
(string $value ) |
| Input |
| string | $value | value of the item |
| Output |
| Exception |
|