I'm trying to use a lightswitch-field in a plugin-config. But for some reason it won't get saved. The lightswitch-field is always off.
protected function defineSettings()
{
return array(
...
'mailerShowInfo' => array(AttributeType::Bool, 'default' => false),
...
);
}
_settings.html:
{{ forms.lightswitchField({
label: "Show info in sidebar?"|t,
id: 'mailerShowInfo',
name: 'mailerShowInfo',
value: settings.mailerShowInfo,
required: true
})
}}
I tried to use AttributeType::Number instead, and even used settype() in prepSettings() to force a boolean conversion, but still nothing.
Any idea what I'm missing?