File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,11 @@ protected function getElementOptions(array $elementConfig): array
334
334
'label ' => $ this ->fromCurrentLocale ($ elementConfig ['label ' ])
335
335
];
336
336
337
+ if ($ elementConfig ['type ' ] === 'bool ' ) {
338
+ $ options ['checkedValue ' ] = 'checked ' ;
339
+ $ options ['uncheckedValue ' ] = 'unchecked ' ;
340
+ }
341
+
337
342
if (isset ($ elementConfig ['help ' ])) {
338
343
$ options ['description ' ] = $ this ->fromCurrentLocale ($ elementConfig ['help ' ]);
339
344
}
@@ -398,6 +403,10 @@ protected function fromCurrentLocale(array $localeMap): ?string
398
403
private function filterConfig (array $ config ): array
399
404
{
400
405
foreach ($ config as $ key => $ value ) {
406
+ if (in_array ($ value , ['checked ' , 'unchecked ' ], true )) {
407
+ $ config [$ key ] = $ value === 'checked ' ;
408
+ }
409
+
401
410
if (isset ($ this ->defaultChannelOptions [$ key ])) {
402
411
if ($ value === null ) {
403
412
$ config [$ key ] = '' ;
You can’t perform that action at this time.
0 commit comments