Am 22.07.2011, 17:06 Uhr, schrieb David Mintz <da...@davidmintz.org>:

I noticed that $helper is a public property of Zend_Form_Element_Select, so
rather than extending it, I have started working on a custom view helper
instead, whose method signature is the same as that of formSelect in
Zend_View_Helper_FormSelect.

But the $options array that I am going to pass the Zend_Form_Element_Select
constructor won't be like array( 1=> apple, 2 => spinach ), but rather
array( array(value=>1,label=>spinach, class=>vegetable ), ... )

Any thoughts about this approach? I know that it's kind of crude to
deliberately abuse Zend_Form_Element_Select's constructor and then give it a
custom view helper to make up for it, but it looks like it's gonna work.


Use CSS:

option[label='Foo'] {
    background-color: red;
}

option[label='Bar'] {
    background-color: yellow;
}

Or look at the issue tracker: http://framework.zend.com/issues/browse/ZF-3580

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to