ZF-6355: Zend_Form_Element_File does not render attributes

Issue Type: Bug Created: 2009-04-20T06:29:13.000+0000 Last Updated: 2009-04-23T23:16:49.000+0000 Status: Resolved Fix version(s): Reporter: Jasper van Putten (jasper) Assignee: Thomas Weidner (thomas) Tags: - Zend_Form

Related issues: Attachments:


$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)


Posted by Thomas Weidner (thomas) on 2009-04-23T14:54:02.000+0000

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.

Posted by Thomas Weidner (thomas) on 2009-04-23T15:02:08.000+0000

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

Posted by Jasper van Putten (jasper) on 2009-04-23T23:16:38.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.