Personally I have never tried making an options array like that. I always put my value in value="" that I want to be added to the options array.
PHP Code:
<?php if( !empty($groups['department']) ): ?>
<div class="form-group">
<?php echo form_label(lang('groups_type_department'),'documents_department[]'); ?>
<p class="help-block"><?php echo nl2br(lang('documents_department_help')); ?></p>
<?php foreach($groups['department'] as $group_id => $group_name): ?>
<div class="checkbox">
<label>
<?php echo form_checkbox('documents_department[]', $group_id, set_checkbox('documents_department[]', $group_id, in_array($group_id, $groups_checked))) . $group_name; ?>
</label>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
And grabbing it like this, to retrieve the actual value.
PHP Code:
public function _get_documents_department()
{
return $this->input->post('documents_department') ? $this->input->post('documents_department') : array();
}
In case I want to have the name and ID i put value="key_value", and make an explode('_', $array); on the other end. If I for some reason don't want to use multiple names for different settings.