Issues

ZF-4487: Zend_Form_Element_File is not rendering the default form decorators

Issue Type: Bug Created: 2008-10-04T12:57:13.000+0000 Last Updated: 2008-10-06T12:48:16.000+0000 Status: Resolved Fix version(s): - 1.6.2 (13/Oct/08)

Reporter: Chris Martin (cgmartin) Assignee: Thomas Weidner (thomas) Tags: - Zend_Form

Related issues: Attachments:

Description

When attaching a Zend_Form_Element_File to a Zend_Form, the default decorators are not being rendered (Errors, HtmlTag, Label, etc).

<pre class="highlight">
class App_Form_FileTest extends Zend_Form
{
    /**
     * Form initialization
     *
     * @return void
     */
    public function init()
    {

        $this->setAttribs(array(
            'name'  => 'postForm',
            'method' => 'post',
            'enctype' => 'multipart/form-data'
        ));


        $this->addElement(
            'Textarea',
            'postmessage',
            array(
                'value'      => '',
                'label'      => 'Message:',
                'required'  => true,
                'style'    => 'height: 150px; width:400px',
                //'propercase' => true,
            )
        );

        $this->addElement(
            new Zend_Form_Element_File(
                'moviefile',
                array(
                    'label' => 'Attach Movie:',
                    'required' => false,
                    'order' => 20,
                    'destination' => Zend_Registry::get('config')->upload_dir,
                    'validators' => array(
                                 array('Count', false, 1),
                                 array('Size', false, 5242880), // 5 megs
                                 array('Extension', false, 'avi,mpg,mpeg,flv,png')
                            )
                )
            )
        );
    }
}

Renders the file element without the default decorators:

<pre class="highlight">



Message:
    

    

Found in http://framework.zend.com/svn/framework/… (rev 11673)

Comments

Posted by Thomas Weidner (thomas) on 2008-10-06T12:48:15.000+0000

Fixed with r11704

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