65 $this->attributes[$name] = $value;
73 return $this->attributes[$name] ??
null;
80 public function addOption( $label, $value =
false ) {
81 $value = $value !==
false ? $value : $label;
82 $this->options[] = [ $label => $value ];
108 foreach (
$options as $label => $value ) {
109 if ( is_array( $value ) ) {
111 $data .= Html::rawElement(
'optgroup', [
'label' => $label ], $contents ) .
"\n";
117 $data .=
Xml::option( $label, $value, $selected ) .
"\n";
130 foreach ( $this->options as
$options ) {
134 return Html::rawElement( $this->tagName, $this->attributes, rtrim( $contents ) );