I have the problem, that the following Zend Form throws an error. The problem is the "file"-element and using setElementDecorators.
class Products_AddForm extends Zend_Form
{
function init() {
// other form elements...
$uploadElement = new Zend_Form_Element_File('Excel');
$uploadElement->setLabel('Excel');
$this->addElement($uploadElement);
$this->setElementDecorators(array(
'ViewHelper',
'Errors',
array(array('data' => 'HtmlTag'), array('tag' => 'td')),
array('Label', array('tag' => 'th')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr'))
));
}
}
This throws an error.
(Warning: Exception caught by form: No file decorator found... unable to render file element Stack Trace: #0 )
Adding $uploadElement->addDecorator('File');
at the end after the SetElementDecorators
will work, but this will give me the file element twice!
Can anybody help, please?
TIA Matt