PHP Class Prado\Web\UI\WebControls\TListItem

TListItem represents an item in a list control. Each item has a {@link setText Text} property and a {@link setValue Value} property. If either one of them is not set, it will take the value of the other property. An item can be {@link setSelected Selected} or {@link setEnabled Enabled}, and it can have additional {@link getAttributes Attributes} which may be rendered if the list control supports so.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TComponent
Show file Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
__construct ( $text = '', $value = '', $enabled = true, $selected = false ) Constructor.
getAttribute ( $name ) : string
getAttributes ( ) : TAttributeCollection
getEnabled ( ) : boolean
getHasAttributes ( ) : boolean
getSelected ( ) : boolean
getText ( ) : string
getValue ( ) : string
hasAttribute ( $name ) : boolean
removeAttribute ( $name ) : string Removes the named attribute.
setAttribute ( $name, $value )
setEnabled ( $value )
setSelected ( $value )
setText ( $value )
setValue ( $value )

Protected Methods

Method Description
_getZappableSleepProps ( &$exprops ) Returns an array with the names of all variables of this object that should NOT be serialized because their value is the default one or useless to be cached for the next page loads.

Method Details

__construct() public method

Constructor.
public __construct ( $text = '', $value = '', $enabled = true, $selected = false )

_getZappableSleepProps() protected method

Reimplement in derived classes to add new variables, but remember to also to call the parent implementation first.
protected _getZappableSleepProps ( &$exprops )

getAttribute() public method

public getAttribute ( $name ) : string
return string the named attribute value, null if attribute does not exist

getAttributes() public method

public getAttributes ( ) : TAttributeCollection
return Prado\Collections\TAttributeCollection custom attributes

getEnabled() public method

public getEnabled ( ) : boolean
return boolean whether the item is enabled

getHasAttributes() public method

public getHasAttributes ( ) : boolean
return boolean whether the item has any custom attribute

getSelected() public method

public getSelected ( ) : boolean
return boolean whether the item is selected

getText() public method

public getText ( ) : string
return string text of the item

getValue() public method

public getValue ( ) : string
return string value of the item

hasAttribute() public method

public hasAttribute ( $name ) : boolean
return boolean whether the named attribute exists

removeAttribute() public method

Removes the named attribute.
public removeAttribute ( $name ) : string
return string attribute value removed, empty string if attribute does not exist.

setAttribute() public method

public setAttribute ( $name, $value )

setEnabled() public method

public setEnabled ( $value )

setSelected() public method

public setSelected ( $value )

setText() public method

public setText ( $value )

setValue() public method

public setValue ( $value )