extends |
XoopsFormElement |
---|
A select field
Methods | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(string $caption, string $name, mixed $value = null, int $size = 1, bool $multiple = false)
Constructor
Constructor Parameters
OverridesOverriden by |
# | ||||||||||
public
|
isMultiple(): bool
Are multiple selections allowed?
Are multiple selections allowed? |
# | ||||||||||
public
|
getSize(): int
Get the size
Get the size |
# | ||||||||||
public
|
getValue(bool $encode = false): array
Get an array of pre-selected values
Get an array of pre-selected values Parameters
|
# | ||||||||||
public
|
setValue(mixed $value)
Set pre-selected values
Set pre-selected values |
# | ||||||||||
public
|
addOption(string $value, string $name = '')
Add an option
Add an option Parameters
|
# | ||||||||||
public
|
addOptionArray(array $options)
Add multiple options
Add multiple options Parameters
|
# | ||||||||||
public
|
getOptions(bool|int $encode = false): array
Get an array with all the options
Get an array with all the options Note: both name and value should be sanitized. However, for backward compatibility, only value is sanitized for now. Parameters
ReturnsAssociative array of value->name pairs |
# | ||||||||||
public
|
render(): string
Prepare HTML for output
|
# | ||||||||||
public
|
renderValidationJS()
Render custom javascript validation code
|
# |
Properties | |||
---|---|---|---|
public
|
array
|
$_options = []
|
# |
public
|
bool
|
$_multiple = false
|
# |
public
|
int
|
$_size
|
# |
public
|
array
|
$_value = []
|
# |
Properties inherited from XoopsFormElement |
---|
$customValidationCode, $_name, $_caption, $_accesskey, $_class, $_hidden, $_extra, $_required, $_description, $_nocolspan, $_formtype |