Zend_Form_Element_MultiSelect element definition

后端 未结 1 1309
梦毁少年i
梦毁少年i 2021-01-07 11:38

Is there any way to define which options in Zend_Form_Element_MultiSelect would be selected by default?

相关标签:
1条回答
  • 2021-01-07 12:01
      $element = new Zend_Form_Element_MultiCheckbox('foo', array(
          'multiOptions' => array(
              'foo' => 'Foo Option',
              'bar' => 'Bar Option',
              'baz' => 'Baz Option',
              'bat' => 'Bat Option',
        );
      ));
      $element->setValue(array('bar', 'bat'));
    

    http://framework.zend.com/manual/en/zend.form.standardElements.html#zend.form.standardElements.multiCheckbox

    0 讨论(0)
提交回复
热议问题