Reputation: 27038
i am trying to create a checkbox group, something like:
Checkbox Label
|_| Checkbox1
|_| Checkbox2
...
i found this code that renders one checkbox only
$this->add(array(
'name' => 'checkbox',
'type' => 'Zend\Form\Element\Checkbox',
'options' => array(
'label' => 'A checkbox ',
'checked_value' => 'good',
'unchecked_value' => 'bad',
)
));
any ideas? thanks
Upvotes: 1
Views: 8939
Reputation: 1350
There is article with full example of multicheckbox processing (including storing/reading in DB):
Upvotes: 2
Reputation: 2139
I think this is what you're looking for: http://framework.zend.com/manual/2.0/en/modules/zend.form.elements.html#multicheckbox-element
Upvotes: 3