XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
XoopsFormSelect Class Reference
Inheritance diagram for XoopsFormSelect:
XoopsFormElement XoopsFormSelectCountry XoopsFormSelectGroup XoopsFormSelectLang XoopsFormSelectMatchOption XoopsFormSelectTheme XoopsFormSelectTimezone XoopsFormSelectUser

Public Member Functions

 __construct ($caption, $name, $value=null, $size=1, $multiple=false)
 
 isMultiple ()
 
 getSize ()
 
 getValue ()
 
 setValue ($value)
 
 addOption ($value, $name='')
 
 addOptionArray ($options)
 
 getOptions ()
 
 render ()
 
- Public Member Functions inherited from XoopsFormElement
 __construct ()
 
 XoopsFormElement ()
 
 isContainer ()
 
 setName ($name)
 
 getName ($encode=true)
 
 setId ($id)
 
 getId ()
 
 setAccessKey ($key)
 
 getAccessKey ()
 
 getAccessString ($str)
 
 setClass ($class)
 
 getClass ()
 
 setCaption ($caption)
 
 getCaption ()
 
 setDescription ($description)
 
 getDescription ()
 
 setHidden ()
 
 isHidden ()
 
 isBreak ()
 
 setExtra ($extra, $replace=false)
 
 getExtra ()
 
 getMessageForJS ()
 

Data Fields

 $_options = []
 
 $_multiple = false
 
 $_size
 
 $_value = []
 
- Data Fields inherited from XoopsFormElement
 $_name
 
 $_caption
 
 $_accesskey = ''
 
 $_class = ''
 
 $_hidden = false
 
 $_extra = ''
 
 $_required = false
 
 $_description = ''
 
 $_id = null
 

Detailed Description

Definition at line 18 of file formselect.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $caption,
$name,
$value = null,
$size = 1,
$multiple = false )

Constructor

Parameters
string$captionCaption
string$name"name" attribute
mixed$valuePre-selected value (or array of them).
int$sizeNumber or rows. "1" makes a drop-down-list
bool$multipleAllow multiple selections?

Definition at line 58 of file formselect.php.

Member Function Documentation

◆ addOption()

addOption ( $value,
$name = '' )

Add an option

Parameters
string$value"value" attribute
string$name"name" attribute

Definition at line 121 of file formselect.php.

◆ addOptionArray()

addOptionArray ( $options)

Add multiple options

Parameters
array$optionsAssociative array of value->name pairs

Definition at line 135 of file formselect.php.

◆ getOptions()

getOptions ( )

Get all options

Returns
array Associative array of value->name pairs

Definition at line 149 of file formselect.php.

◆ getSize()

getSize ( )

Get the size

Returns
int

Definition at line 84 of file formselect.php.

◆ getValue()

getValue ( )

Get an array of pre-selected values

Returns
array

Definition at line 94 of file formselect.php.

◆ isMultiple()

isMultiple ( )

Are multiple selections allowed?

Returns
bool

Definition at line 74 of file formselect.php.

◆ render()

render ( )

Prepare HTML for output

Returns
string HTML

Reimplemented from XoopsFormElement.

Definition at line 159 of file formselect.php.

◆ setValue()

setValue ( $value)

Set pre-selected values

Parameters
mixed$value

Definition at line 104 of file formselect.php.

Field Documentation

◆ $_multiple

$_multiple = false

Definition at line 33 of file formselect.php.

◆ $_options

$_options = []

Definition at line 26 of file formselect.php.

◆ $_size

$_size

Definition at line 40 of file formselect.php.

◆ $_value

$_value = []

Definition at line 47 of file formselect.php.


The documentation for this class was generated from the following file: