In 1.6, for multiple checkboxes in adminController, let's say I have this in renderForm()
$this->fields_form['input'][] = [
'type' => 'checkbox',
'name' => 'buttons[]',
'label' => $this->l('Checkboxes'),
'class' => 'chosen',
'multiple' => true,
'required' => true,
'values' => array(
'query' => $buttons,
'id' => 'id_button',
'name' => 'name'
),
];
According to this line in adminer/themes/default/template/helpers/form/form.tpl
<input type="checkbox"
name="{$id_checkbox}"
id="{$id_checkbox}"
...
{if isset($fields_value[$id_checkbox]) && $fields_value[$id_checkbox]} checked="checked"{/if} />
I'd have to send stored values from db in $checkboxes into Helper->fields_value, in my case like this:
foreach ($checkboxes as $cb) {
$this->fields_value['buttons[]_'.$cb] = true;
}
voilá, checkboxes are checked