How do i create this with $this->formSelect() ?
<select multiple>
<optgroup label="a">
<option>1</option>
<option>2</option>
</optgroup>
<optgroup label="b">
<option>1</option>
</optgroup>
</select>
How do i create this with $this->formSelect() ?
<select multiple>
<optgroup label="a">
<option>1</option>
<option>2</option>
</optgroup>
<optgroup label="b">
<option>1</option>
</optgroup>
</select>
In Zend Framework 2 this can be done as follows:
please note that an option named empty_options doesn't exist instead empty_option should be used.
For the Zend_Form_Element_Select() it goes like this
Note that you also have addMultiOption($option,$value) and addMultiOptions($options). Simply include the value or options in an additional array.