Upload de arquivos Zend e decoradores de elementos
Tenho o problema, que o seguinte formulário do Zend gera um erro. O problema é o elemento "arquivo" e o uso de 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'))
));
}
}
Isto gera um erro.
(Warning: Exception caught by form: No file decorator found... unable to render file element Stack Trace: #0 )
Adding$uploadElement->addDecorator('File');
no final após oSetElementDecorators
funcionará, mas isso me dará o elemento file duas vezes!
Pode alguém ajudar, por favor?
TIA Matt