次のZendフォームがエラーをスローするという問題があります。問題は「ファイル」要素と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 )
$uploadElement->addDecorator('File');
の後に最後に追加するSetElementDecorators
と機能しますが、これによりファイル要素が2回得られます!
誰か助けてもらえますか?
TIAマット