任何人都可以帮我在Zend框架中制作这样的html吗?
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
我正在使用此代码但不能像我想要的那样
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel($this->_translate->_('pictures') . ':')
->addValidator('IsImage')
->addValidator('Size', false, 204800)
->addValidator('Extension', false, 'jpg,png,gif')
->setDestination($_SERVER['DOCUMENT_ROOT'] . '/uploads')
->setValueDisabled(true)
->setAttrib('multiple', 'multiple')
->setIsArray(true)
->removeDecorator('Label');
....
....
$this->addElements(array($photo));
答案 0 :(得分:1)
您可以使用Zend_Form_Decorator_HtmlTag
或编写自己的装饰器。有two brief examples here,但此网站有点旧 - 所以请务必查看documentation of Zend Framework