API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsFormSelect Class Reference
Inheritance diagram for XoopsFormSelect:
Collaboration diagram for XoopsFormSelect:

Public Member Functions

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

Data Fields

 $_options = array()
 
 $_multiple = false
 
 $_size
 
 $_value = array()
 
- Data Fields inherited from XoopsFormElement
 $customValidationCode = array()
 
 $_name
 
 $_caption
 
 $_accesskey = ''
 
 $_class = array()
 
 $_hidden = false
 
 $_extra = array()
 
 $_required = false
 
 $_description = ''
 
 $_nocolspan = false
 
 $_formtype = ''
 

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?

Reimplemented in XoopsFormSelectTheme.

Here is the call graph for this function:

Member Function Documentation

◆ addOption()

addOption (   $value,
  $name = '' 
)

Add an option

Parameters
string$value"value" attribute
string$name"name" attribute
Here is the caller graph for this function:

◆ addOptionArray()

addOptionArray (   $options)

Add multiple options

Parameters
array$optionsAssociative array of value->name pairs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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$encodeTo 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
Here is the caller graph for this function:

◆ getSize()

getSize ( )

Get the size

Returns
int
Here is the caller graph for this function:

◆ getValue()

getValue (   $encode = false)

Get an array of pre-selected values

Parameters
bool$encodeTo sanitizer the text?
Returns
array
Here is the caller graph for this function:

◆ isMultiple()

isMultiple ( )

Are multiple selections allowed?

Returns
bool
Here is the caller graph for this function:

◆ render()

render ( )

Prepare HTML for output

Returns
string HTML

Reimplemented from XoopsFormElement.

Here is the call graph for this function:

◆ renderValidationJS()

renderValidationJS ( )

Render custom javascript validation code

@seealso XoopsForm::renderValidationJS

Reimplemented from XoopsFormElement.

Here is the call graph for this function:

◆ setValue()

setValue (   $value)

Set pre-selected values

Parameters
mixed$value
Here is the caller graph for this function:

Field Documentation

◆ $_multiple

$_multiple = false

◆ $_options

$_options = array()

◆ $_size

$_size

◆ $_value

$_value = array()

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