doumei4964
2015-07-08 09:48
浏览 27
已采纳

Zend_Form输入数组

Using Zend_Form, how would I create form elements like this:

<input type="file" name="file[]" value="" />
<input type="file" name="file[]" value="" />

If i don't know how many files user want to upload. Now the settings for the input type="file" look

form.elements.file.type = "File"
form.elements.file.options.required = true
form.elements.file.options.label = "File"
form.elements.file.options.validators.extension.validator = "Extension"
form.elements.file.options.validators.extension.options.extension = "gif,jpg,jpeg,png,swf"
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doufei4418 2015-07-08 11:52
    已采纳

    Please try with this

        $image = new Zend_Form_Element_File("image");
        $image->setAttrib('multiple', true)
               ->setIsArray(true)
               ->addValidator('Extension', false, 'gif,jpg,jpeg,png,swf');
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题