◆ __construct()
| __construct |
( |
|
$caption, |
|
|
|
$name, |
|
|
|
$value = null, |
|
|
|
$size = 1, |
|
|
|
$multiple = false |
|
) |
| |
Constructor
- Parameters
-
| string | $caption | Caption |
| string | $name | "name" attribute |
| mixed | $value | Pre-selected value (or array of them). |
| int | $size | Number or rows. "1" makes a drop-down-list |
| bool | $multiple | Allow multiple selections? |
Reimplemented in XoopsFormSelectTheme.
◆ addOption()
| addOption |
( |
|
$value, |
|
|
|
$name = '' |
|
) |
| |
Add an option
- Parameters
-
| string | $value | "value" attribute |
| string | $name | "name" attribute |
◆ addOptionArray()
| addOptionArray |
( |
|
$options | ) |
|
Add multiple options
- Parameters
-
| array | $options | Associative array of value->name pairs |
◆ getOptions()
| getOptions |
( |
|
$encode = false | ) |
|
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
-
| bool | int | $encode | To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name |
- Returns
- array Associative array of value->name pairs
◆ getSize()
◆ getValue()
| getValue |
( |
|
$encode = false | ) |
|
Get an array of pre-selected values
- Parameters
-
| bool | $encode | To sanitizer the text? |
- Returns
- array
◆ isMultiple()
Are multiple selections allowed?
- Returns
- bool
◆ render()
◆ renderValidationJS()
◆ setValue()
Set pre-selected values
- Parameters
-
◆ $_multiple
◆ $_options
◆ $_size
◆ $_value
The documentation for this class was generated from the following file: