ZF-4487: Zend_Form_Element_File is not rendering the default form decorators
Description
When attaching a Zend_Form_Element_File to a Zend_Form, the default decorators are not being rendered (Errors, HtmlTag, Label, etc).
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:
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