Zend talk.I在我的web应用程序中构建一个自定义的Zend_form。问题是我无法显示错误(当我提交没有任何文本的表单时)。我错过了明显的东西吗?Zend form:错误不会显示
class Commentform extends Zend_Form
{
public function init()
{
$this->setMethod('post');
$this->setAction('');
$text=new Zend_Form_Element_Textarea('text');
$text->setRequired(true)
->addFilter('StringTrim')
->addFilter('StripTags')
->setDescription('bla bla');
$submit=new Zend_Form_Element_Submit('commenta');
$this->addElements(array($text,$submit));
$this->setElementDecorators(array(
'ViewHelper',
array('Description',array(
'tag'=>'span','class'=>'medium','placement'=>'PREPEND')),
));
$this->setDecorators(array(
'FormElements',
'FormErrors',
'Form',array('Description',array('tag'=>'h2','placement'=>'prepend')),
array('HtmlTag', array('tag' => 'div','class'=>'write_comment')),
));
$this->setDescription('zend zend');
}
}
感谢
卢卡