Level51\DropdownsField\DropdownsField
A FormField which renders multiple dropdowns and stores the results as a JSON object.
Synopsis
class DropdownsField
extends FormField
{
- // members
- protected $source;
- protected $valueOptions;
- protected boolean $hasEmptyDefault = false;
- protected string $emptyString = '';
- // methods
- public void __construct()
- public DBHTMLText Field()
- public string getPayload()
- public array|null Value()
- public array getFrontendI18NPayload()
- public $this setSource()
- public $this setValueOptions()
- public $this setHasEmptyDefault()
- public $this setEmptyString()
- public array getSource()
- public array getValueOptions()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Tasks
Line | Task |
---|---|
15+ | cleanup and documentation |
112+ | define i18n payload if needed |
Members
protected
- $emptyString
- $hasEmptyDefault
- $source
- $valueOptions
Methods
public
- __construct() — DropdownsField constructor.
- Field()
- Value() — Get the field value as array if a value is set.
- getFrontendI18NPayload() — Get a list of all labels used within the frontend.
- getPayload() — Get the payload passed to the vue component.
- getSource()
- getValueOptions()
- setEmptyString()
- setHasEmptyDefault()
- setSource() — Set the field source.
- setValueOptions() — Set the available value options.