0
我有下面的代碼,從表中創建一個子窗體,我有錯誤描述保存在數據庫中,我知道如何設置它爲普通元素,但不是當它是一個子窗體時,我如何添加自定義錯誤每個子表單元素的消息?如何將ErrorDescription添加到Zend子表單元素?
$subForm = new Zend_Form_SubForm();
foreach($configuration as $config){
$elements[] = array(
new Zend_Form_Element_Text($config->configuration_key, array(
'required' => (($config->is_required == 1) ? true : false),
'label' => $config->configuration_title,
'filters' => array('StringTrim'),
'value' => $config->configuration_value,
'Options' => array('style'=>'width:90%;'),
'Description' => $config->configuration_description,
'errorMessage' => $config->errorMessage,
))
);
}
$subForm->addElements($elements);
$this->addSubForm($subForm, 'configuration');