Jet\Form_Field_Select / Form_Field::TYPE_SELECT
Presents a form field of type SELECT with one option selected from a list of options.
You need to familiarize yourself with the choices section.
The Jet\Form_Renderer_Field_Input_Select renderer is used to display the form field itself.
Default error codes
| Code | Meaning of |
|---|---|
| Form_Field::ERROR_CODE_EMPTY | The field is marked as required and the value is not selected. |
| Form_Field::ERROR_CODE_INVALID_VALUE | The entered value does not match any of the predefined values. |
Parameters
| Parameter | Type | Required | Meaning of |
|---|---|---|---|
| select_options | assoc array | no | List of options |
| select_options_creator | callable | no | Calling a method that generates a list of selection options. |
Methods
| Method | Meaning of |
|---|---|
| public setSelectOptions( array|Iterator $options ) : void |
Sets a list of options. |
| public getSelectOptions( ) : array |
Returns the set list of options. |
| public optionIsSelected( string $option_key ) : bool |
Indicates whether the option is selected based on the captured and validated value (or default value) of the form element. |