ZF-2714: Form Image setAttrib() not rendering to html
Description
Using setAttrib() to set class for Image Element dose not render to html (class="") however this method works for other form elements.
Also the helper in the Image attributes is formText. Shouldn't that be formImage?
$image = new Zend_Form_Element_Image('submitImage');
$image->setLabel('')
->setValue('image.gif')
->setAttrib('class', 'button')
->setAttrib('foo', 'bar');
var_dump($image->getAttribs());
Outputs: array(3) { ["helper"]=> string(8) "formText" ["class"]=> string(6) "button" ["foo"]=> string(3) "bar" }
HTML:
This behavior is with Zend_Form_Element_Image and not with any other (Text, Textarea, etc.), these all render the attrib to html.
Comments
Posted by Wil Sinclair (wil) on 2008-02-25T13:46:57.000+0000
Unsetting 'fix version' and 'fix version priority' until this issue is reviewed. Assigning to Matthew for review.
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-05T10:07:58.000+0000
Image decorator is indeed not pulling in element properties to set element attributes; scheduling for GA release.
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-06T14:45:06.000+0000
Fix committed to trunk and release branch