Zend Framework

Zend_View_Helper_FormSelect and multiples

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.0.0 RC3
  • Fix Version/s: 1.5.0
  • Component/s: Zend_View
  • Labels:
    None
  • Fix Version Priority:
    Nice to Have

Description

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.

Issue Links

Activity

Hide
Bill Karwin added a comment -

Assign to Matthew.

Show
Bill Karwin added a comment - Assign to Matthew.
Hide
Matthew Weier O'Phinney added a comment -

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.

Show
Matthew Weier O'Phinney added a comment - 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.
Hide
Matthew Weier O'Phinney added a comment -

Fixed in trunk

Show
Matthew Weier O'Phinney added a comment - Fixed in trunk

People

Vote (0)
Watch (0)

Dates

  • Due:
    Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified