class SelectList extends HtmlElement (View source)

The SelectList class.

Methods

__construct(string $name, mixed|null $options = array(), array $attribs = array(), mixed $selected = null, bool $multiple = false)

Constructor

string
toString(boolean $forcePair = false)

toString

string
render(boolean $forcePair = false)

Alias of toString()

string
__toString()

Convert this object to string.

mixed
getContent()

Get content.

setContent(mixed $content)

Set content.

string
getAttribute(string $name, mixed $default = null)

Get attributes.

setAttribute(string $name, string $value)

Set attribute value.

array
getAttributes()

Get all attributes.

setAttributes(array $attribs)

Set all attributes.

string
getName()

Get element tag name.

setName(string $name)

Set element tag name.

boolean
offsetExists(mixed $offset)

Whether a offset exists

mixed
offsetGet(mixed $offset)

Offset to retrieve

void
offsetSet(mixed $offset, mixed $value)

Offset to set

void
offsetUnset(mixed $offset)

Offset to unset

static SelectList
create($name, $attribs = array())

Quick create for PHP 5.3

addOption(Option $option, string $group = null)

addOption

option(string $text = null, string $value = null, array $attribs = array(), string $group = null)

option

mixed
getSelected()

Method to get property Selected

setSelected(mixed $selected)

Method to set property selected

void
__clone()

__clone

boolean
getMultiple()

Method to get property Multiple

setMultiple(boolean $multiple)

Method to set property multiple

Details

at line line 51
__construct(string $name, mixed|null $options = array(), array $attribs = array(), mixed $selected = null, bool $multiple = false)

Constructor

Parameters

string $name Element tag name.
mixed|null $options
array $attribs Element attributes.
mixed $selected
bool $multiple

at line line 121
string toString(boolean $forcePair = false)

toString

Parameters

boolean $forcePair

Return Value

string

in DomElement at line line 79
string render(boolean $forcePair = false)

Alias of toString()

Parameters

boolean $forcePair

Return Value

string

in DomElement at line line 89
string __toString()

Convert this object to string.

Return Value

string

in DomElement at line line 106
mixed getContent()

Get content.

Return Value

mixed

in DomElement at line line 118
DomElement setContent(mixed $content)

Set content.

Parameters

mixed $content Element content.

Return Value

DomElement Return self to support chaining.

in DomElement at line line 133
string getAttribute(string $name, mixed $default = null)

Get attributes.

Parameters

string $name Attribute name.
mixed $default Default value.

Return Value

string The attribute value.

in DomElement at line line 151
DomElement setAttribute(string $name, string $value)

Set attribute value.

Parameters

string $name Attribute name.
string $value The value to set into attribute.

Return Value

DomElement Return self to support chaining.

in DomElement at line line 163
array getAttributes()

Get all attributes.

Return Value

array All attributes.

in DomElement at line line 175
DomElement setAttributes(array $attribs)

Set all attributes.

Parameters

array $attribs All attributes.

Return Value

DomElement Return self to support chaining.

in DomElement at line line 187
string getName()

Get element tag name.

Return Value

string

in DomElement at line line 199
DomElement setName(string $name)

Set element tag name.

Parameters

string $name Set element tag name.

Return Value

DomElement Return self to support chaining.

in DomElement at line line 214
boolean offsetExists(mixed $offset)

Whether a offset exists

Parameters

mixed $offset An offset to check for.

Return Value

boolean True on success or false on failure. The return value will be casted to boolean if non-boolean was returned.

in DomElement at line line 226
mixed offsetGet(mixed $offset)

Offset to retrieve

Parameters

mixed $offset The offset to retrieve.

Return Value

mixed Can return all value types.

in DomElement at line line 244
void offsetSet(mixed $offset, mixed $value)

Offset to set

Parameters

mixed $offset The offset to assign the value to.
mixed $value The value to set.

Return Value

void

in DomElement at line line 256
void offsetUnset(mixed $offset)

Offset to unset

Parameters

mixed $offset The offset to unset.

Return Value

void

at line line 68
static SelectList create($name, $attribs = array())

Quick create for PHP 5.3

Parameters

$name
$attribs

Return Value

SelectList

at line line 81
SelectList addOption(Option $option, string $group = null)

addOption

Parameters

Option $option
string $group

Return Value

SelectList

at line line 109
SelectList option(string $text = null, string $value = null, array $attribs = array(), string $group = null)

option

Parameters

string $text
string $value
array $attribs
string $group

Return Value

SelectList

at line line 200
mixed getSelected()

Method to get property Selected

Return Value

mixed

at line line 212
SelectList setSelected(mixed $selected)

Method to set property selected

Parameters

mixed $selected

Return Value

SelectList Return self to support chaining.

at line line 224
void __clone()

__clone

Return Value

void

at line line 234
boolean getMultiple()

Method to get property Multiple

Return Value

boolean

at line line 246
SelectList setMultiple(boolean $multiple)

Method to set property multiple

Parameters

boolean $multiple

Return Value

SelectList Return self to support chaining.