मुझे समस्या है, कि निम्न ज़ेंड फ़ॉर्म एक त्रुटि फेंकता है। समस्या "फ़ाइल" -element है और 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'))
));
}
}
यह एक त्रुटि फेंकता है।
(Warning: Exception caught by form: No file decorator found... unable to render file element Stack Trace: #0)
काम करेंगे SetElementDecorators
के बाद अंत में $uploadElement->addDecorator('File');
जोड़ा जा रहा है, लेकिन यह मुझे फ़ाइल तत्व दो बार दे देंगे!
क्या कोई मदद कर सकता है, कृपया?
TIA मैट
धन्यवाद 4 आपकी मदद। इसे फेंकना: चेतावनी: फॉर्म द्वारा पकड़ा अपवाद: विधि प्राप्त करें मैक्सफ़ाइल आकार मौजूद नहीं है स्टैक ट्रेस: # 0 – frgtv10
मेरा उत्तर अपडेट किया है :) –
जो काम करता है। havnt zend के दस्तावेज़ों में यह देखा !? :/ धन्यवाद! – frgtv10