Class: Select
Source Location: /HtmlForm.FormElement.Select.class.php
FormElement
|
--Select
Wraps a select.
Author(s):
Version:
|
|
|
Child classes:
|
Inherited Constants
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
static method get [line 65]
static Select get(
String
$name, [String
$id = ''])
|
|
Factory method for Select, returns new instance. Factories are used to make instant chaining possible.
Tags:
Overridden in child classes as:
- SelectList::get()
- Factory method for SelectList, returns new instance.
Parameters:
constructor __construct [line 42]
Select __construct(
String
$name, [String
$id = ''])
|
|
Hidden constructor. Get new instances with "get()" instead.
Tags:
Overrides FormElement::__construct() (General abstract, hidden formelement constructor.)
Parameters:
method doRender [line 375]
Compiles and returns the html-fragment for the element.
Tags:
Overridden in child classes as:
- SelectList::doRender()
- Compiles and returns the html-fragment for the element.
Overrides FormElement::doRender() (Returns the compiled html-code for the element.)
method getValue [line 227]
String/Array[String] getValue(
)
|
|
Returns the current value of the element. A Select returns either a single string, if it's a single-select or and array of string when being multi-selectable. Both are compiled from the currently selected options of course.
Tags:
Overrides FormElement::getValue() (Returns the value of the element if there is any.)
method isDisabledOption [line 269]
void isDisabledOption(
$index,
$value)
|
|
Tags:
Parameters:
method isSelectedOption [line 259]
void isSelectedOption(
$index,
$value)
|
|
Tags:
Parameters:
method refill [line 290]
Select refill(
[Array[String]|null
$refiller = array()], [Boolean
$condition = true])
|
|
Tries to refill the selected options from existing data. This data can eiter be one of the method-arrays dependent on the method the surrounding form uses or a supplied array of name-value-pairs.
Tags:
Parameters:
method setDisabled [line 203]
Set the element disabled, or set single options disabled.
Tags:
Overrides FormElement::setDisabled() (Set the element disabled.)
Parameters:
method setMultiple [line 189]
Set the select to being a multi-select.
Tags:
method setOptionCssClasses [line 113]
Select setOptionCssClasses(
$classes)
|
|
Sets css-classes to set for the options. This could be used for an even-odd-pattern for example. One specialty of this functionality: the classes cycle. If you have 4 options for example and you define two classes of "even" and "odd", there will be two subsequent groups of "even" and "odd". The order of the classes is that in which the options have been defined.
Tags:
Parameters:
method setOptions [line 84]
Sets all available options of the select. The options have to be given in the form of an associative array, where keys are the option-values and values are the texts for each option. array('val1' => 'nice option', 'val2' => 'not so nice option', ...)
Tags:
Parameters:
method setOptionTitles [line 130]
Select setOptionTitles(
$titles, Array[String]
$classes)
|
|
Sets html-title to set for the options. The same speciality here as with the classes: they cycle, if not enough were defined for all options. If you have 4 options and you define two classes, there will be two subsequent groups of of both titles. The order of the titles is that in which the options have been defined.
Tags:
Parameters:
method setSelected [line 143]
Select setSelected(
*
$selected)
|
|
Sets selected single/multiple options by index/value.
Tags:
Parameters:
method setSingle [line 177]
Set the select to being a single-select.
Tags:
method setSize [line 165]
Sets the amount of rows the select should have, especially needed for multi-selects.
Tags:
Parameters:
method validate [line 318]
Starts the validation-process for the element. Calculates the validity-status, based on the currently selected options, by applying the rules of a present validator. If there is none, the element is always valid.
Tags:
Overrides FormElement::validate() (Starts validation for the element and all subelements according to the rules laid out in the element's validator.)
|
|