Zend talk。我在我的web应用程序中构建了一个自定义的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 );
}
}
谢谢
卢卡