zendframework/zf2 — pull request #1539 by cgmartin (2012-06-21 05:21:21+00:00)
Title: [Form] MultiCheckbox/Radio view helper - overrideable attributes per option

@Freeaqingme had asked on IRC about having the ability to add an attribute to specific multi-checkbox/radio inputs (ie. Wanted to style one checkbox differently). Here's an attempt to solve that.

Borrowed ideas from FormSelect, with it's $optionSpec array which does something similar. I kept the $optionSpec keys the same (used "selected" instead of changing to "checked"), in case one might want to swap out view helpers.

```php
// In a Form...
$multicbElement = new Element('multicb');
$multicbElement->setAttributes(array(
'id' => 'my-multicb',
'labelAttributes' => array(
'class' => 'checkbox inline',
),
'uncheckedValue' => 'uncheckedValue',
'options' => array(
'Option 1' => 'option1',
'Option 2' => array(
'value' => 'option2',
'labelAttributes' => array(
'class' => 'checkbox inline zf-green'
),
),
'Option 3' => 'option3',
'Option 4' => array(
'value' => 'option4',
'disabled' => true,
'labelAttributes' => array(
'class' => 'checkbox inline disabled'
),
'attributes' => (
'class' => 'disabled',
),
),
'Option 5' => 'option5',
),
));
$this->add($multicbElement);
```