File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
resources/views/default/element Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,15 @@ class Select extends Element
1717 protected $ optionsAttributes = [];
1818 protected $ multiple = false ;
1919
20- public function setOptions ($ options , $ attributes = null )
20+ public function setOptions ($ options , $ attributes = [] )
2121 {
2222 if ($ options instanceof Collection)
2323 {
2424 $ options = $ options ->getDictionary ();
2525 }
2626 $ this ->options = $ options ;
2727
28- if ($ attributes )
29- {
30- $ this ->optionsAttributes = $ attributes ;
31- }
28+ $ this ->optionsAttributes = $ attributes ;
3229
3330 return $ this ;
3431 }
Original file line number Diff line number Diff line change 66 @foreach ($attributes as $attributeName => $attributeValue ) {{ $attributeName } } =" {{ $attributeValue } }" @endforeach
77 >
88 @foreach ($options as $key => $option )
9- <option value =" {{ $key } }" @if (array_get ($optionsAttributes , $key ) ) {{ array_get ($optionsAttributes , $key )} } @endif
10- @if (($multiple && $value && in_array ((string )$key , $value , true )) || $value === (string )$key ) selected =" selected" @endif >{{ $option } } </option >
9+ <option value =" {{ $key } }"
10+ @if ($optionAttributes = array_get ($optionsAttributes , $key ) )
11+ @foreach ($optionAttributes as $optionAttributeName => $optionAttributeValue ) {{ $optionAttributeName } } =" {{ $optionAttributeValue } }" @endforeach
12+ @endif
13+ @if (($multiple && $value && in_array ((string )$key , $value , true )) || $value === (string )$key ) selected =" selected" @endif >{{ $option } }
14+ </option >
1115 @endforeach
1216 </select >
1317 <div class =" form__help" >{{ $help } } </div >
You can’t perform that action at this time.
0 commit comments