Issues

ZF-2714: Form Image setAttrib() not rendering to html

Issue Type: Bug Created: 2008-02-22T20:19:59.000+0000 Last Updated: 2008-03-21T16:25:15.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Ken Crane (kcrane377) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:

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?

<pre class="highlight">
$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

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts