Issues

ZF-6355: Zend_Form_Element_File does not render attributes

Description

$image = $this->createElement('file', 'image'); $image ->setLabel('Image') ->setAttrib('class', 'myClass') $this->addElement($image);

The class attribute does not get rendered, seems to be because of line 53 in Zend/View/Helper/FormFile.php

public function formFile($name, $attribs = null) which should be public function formFile($name, $value = null, $attribs = null)

Comments

No, because a file element does not have a value. And the file decorator does call formFile with 2 params, where the second is an array of attributes for this file element.

I can not verify your results... Using setLabel and setAttrib calls I get the image and also the class rendered.

You are correct, It's because I removed the decorator in my code so the attributes were not set properly.