|
13 | 13 |
|
14 | 14 | class Select extends Element |
15 | 15 | { |
16 | | - protected $options = []; |
17 | | - protected $multiple = false; |
| 16 | + protected $options = []; |
| 17 | + protected $optionsAttributes = []; |
| 18 | + protected $multiple = false; |
18 | 19 |
|
19 | | - public function setOptions($options) |
| 20 | + public function setOptions($options, $attributes = []) |
20 | 21 | { |
21 | 22 | if ($options instanceof Collection) |
22 | 23 | { |
23 | 24 | $options = $options->getDictionary(); |
24 | 25 | } |
25 | 26 | $this->options = $options; |
26 | 27 |
|
| 28 | + $this->optionsAttributes = $attributes; |
| 29 | + |
27 | 30 | return $this; |
28 | 31 | } |
29 | 32 |
|
@@ -97,17 +100,18 @@ public function view() |
97 | 100 | } |
98 | 101 |
|
99 | 102 | return view('form::' . $this->theme . '.element.select', [ |
100 | | - 'label' => $this->label, |
101 | | - 'help' => $this->help, |
102 | | - 'placeholder' => $this->placeholder, |
103 | | - 'name' => $this->name, |
104 | | - 'elementName' => $this->elementName, |
105 | | - 'options' => $this->options, |
106 | | - 'error' => $this->error, |
107 | | - 'value' => $this->value, |
108 | | - 'multiple' => $this->multiple, |
109 | | - 'class' => $this->class, |
110 | | - 'attributes' => $this->attributes |
| 103 | + 'label' => $this->label, |
| 104 | + 'help' => $this->help, |
| 105 | + 'placeholder' => $this->placeholder, |
| 106 | + 'name' => $this->name, |
| 107 | + 'elementName' => $this->elementName, |
| 108 | + 'options' => $this->options, |
| 109 | + 'optionsAttributes' => $this->optionsAttributes, |
| 110 | + 'error' => $this->error, |
| 111 | + 'value' => $this->value, |
| 112 | + 'multiple' => $this->multiple, |
| 113 | + 'class' => $this->class, |
| 114 | + 'attributes' => $this->attributes |
111 | 115 | ]); |
112 | 116 | } |
113 | 117 |
|
|
0 commit comments