Lines Matching +full:- +full:- +full:name +full:- +full:only

8 …* Represents a HTML select. Please not that prefilling with input data only works for single value…
21 * @param string $name The name of this form element
25 public function __construct($name, $options, $label = '') argument
27 parent::__construct('dropdown', $name, $label);
28 $this->rmattr('type');
29 $this->optGroups[''] = new OptGroup(null, $options);
30 $this->val('');
46 $this->optGroups[$label] = new OptGroup($label, $options);
47 return end($this->optGroups);
51 * Set or get the optgroups of an Dropdown-Element.
63 return $this->optGroups;
68 $this->optGroups = [];
70 $this->addOptGroup($label, $options);
81 * option-value => array (
82 * 'label' => option-label,
84 * attr-key => attr-value, ...
94 return $this->optGroups['']->options();
96 $this->optGroups[''] = new OptGroup(null, $options);
113 if (isset($this->attributes['multiple'])) {
114 return $this->values;
116 return $this->values[0];
121 $this->values = $this->setValuesInOptGroups((array) $value);
122 if (!$this->values) {
124 $this->values = $this->setValuesInOptGroups((array) $this->getFirstOptionKey());
137 $options = $this->options();
142 foreach ($this->optGroups as $optGroup) {
143 $options = $optGroup->options();
164 foreach ($this->optGroups as $optGroup) {
165 $found = $optGroup->storeValues($values);
180 $attr = $this->attrs();
183 $attr['name'] .= '[]';
184 } elseif ($this->useInput) {
185 // prefilling is only supported for non-multi fields
186 $this->prefillInput();
191 $this->optGroups,
192 static fn($html, OptGroup $optGroup) => $html . $optGroup->toHTML(),