Tôi gặp sự cố, biểu mẫu Zend sau đây phát ra lỗi. Vấn đề là "tập tin" -element và sử dụng setElementDecorators.Tải lên tệp Zend và phần tử trang trí
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'))
));
}
}
Điều này sẽ xảy ra lỗi.
(Warning: Exception caught by form: No file decorator found... unable to render file element Stack Trace: #0)
Thêm $uploadElement->addDecorator('File');
ở cuối sau khi SetElementDecorators
sẽ làm việc, nhưng điều này sẽ cung cấp cho tôi các yếu tố tập tin hai lần!
Có ai giúp được không?
TIA Matt
Cảm ơn 4 sự giúp đỡ của bạn. Thêm ném này: Cảnh báo: Ngoại lệ bị bắt theo hình thức: Phương thức getMaxFileSize không tồn tại Stack Trace: # 0 – frgtv10
Đã cập nhật câu trả lời của tôi :) –
hoạt động. havnt nhận thấy điều này trong tài liệu của zend !? :/ CẢM ƠN! – frgtv10