ZF-1639: Zend_View_Helper_FormSelect and multiples


Zend_View_Helper_FormSelect takes it upon itself to declare a select box as a multiple select box if the name of the control ends in '[]'. While most cases probably warrant this, I have run into an issue with this, and would like to request the ability to specify whether a select box is 'multiple' or not via a key in the $options array, something like array('multiple' => false).

The use case: I have a form where a user can generate n number of select boxes, each one named 'dataTypes[]'.The select boxes should only have one value be selectable, and when the form is submitted, $_POST['dataTypes'] should be an array containing each user-selected value, so I have a 1:1 ratio between generated select boxes and user input. Currently, when I use Zend_View::FormSelect to build these select boxes, they are all set to multiple, which is not allowed by my business logic. However, I don't have any way to alter this behavior other than modifying or extending the the Zend_View_Helper_FormSelect class itself.

Not a huge deal, but I think this should be configurable through the base class.


Assign to Matthew.

This goes along with ZF-1292 and and ZF-2230, and requires a bit of re-architecting to achieve. I will target it for the 1.1.0 release.

Fixed in trunk