zend form custom attribute in select option?

前端 未结 6 1075
慢半拍i
慢半拍i 2020-12-29 09:04

I want know how to add custom attribute for option in a select field of Zend form.

PHP:

$option_values = array(\"multiOptions\" => array(
    \"US         


        
6条回答
  •  無奈伤痛
    2020-12-29 09:39

    No need for custom form element at all, what u can do is: $element->setAttrib('disable', array(1, 2, 5));

    As explained at http://pietervogelaar.nl/set-attribute-on-select-option-with-zend_form/

提交回复
热议问题